swift中私有變量是會自定調用dispatch_once
的
<code>
class Network: NSObject {
//MARK: 實例單例
static let sharedInstance = Network()
private override init () {} // 禁止使用 init創建單例的其他實例
}
</code>
swift中私有變量是會自定調用dispatch_once
的
<code>
class Network: NSObject {
//MARK: 實例單例
static let sharedInstance = Network()
private override init () {} // 禁止使用 init創建單例的其他實例
}
</code>