Using a dispatch_once singleton model in Swift

I’m trying to work out an appropriate singleton model for usage in Swift. So far, I’ve been able to get a non-thread safe model working as: class var sharedInstance: TPScopeManager { get { struct Static { static var instance: TPScopeManager? = nil } if !Static.instance { Static.instance = TPScopeManager() } return Static.instance! } } Wrapping … Read more