标签:blog ar 使用 sp div on 问题 log 代码
class SwiftSingleton { class var shared: SwiftSingleton { if !Inner.instance { Inner.instance = SwiftSingleton() } return Inner.instance! } struct Inner { static var instance: SwiftSingleton? } }
Inner.instance = SwiftSingleton()
class SwiftSingleton { class var shared: SwiftSingleton { dispatch_once(&Inner.token) { Inner.instance = SwiftSingleton() } return Inner.instance! } struct Inner { static var instance: SwiftSingleton? static var token: dispatch_once_t = 0 } }
标签:blog ar 使用 sp div on 问题 log 代码
原文地址:http://www.cnblogs.com/xumaple/p/4056372.html