classSingletonObject {
classvarsharedInstance :SingletonObject{
structStatic {
staticvaronceToken :dispatch_once_t=0
staticvarinstance :SingletonObject? =nil
}
dispatch_once(&Static.onceToken) {
Static.instance =SingletonObject()
returnStatic.instance!
}
}