{"action":"closed","issue":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/1056","repository_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX","labels_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/1056/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/1056/comments","events_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-iOS-OSX/issues/1056/events","html_url":"https://github.com/ParsePlatform/Parse-SDK-iOS-OSX/issues/1056","id":183507708,"number":1056,"title":"dispatch_once_t is unavailable in Swift 3","user":{"login":"johnantoni","id":15571,"avatar_url":"https://avatars.githubusercontent.com/u/15571?v=3","gravatar_id":"","url":"https://api.github.com/users/johnantoni","html_url":"https://github.com/johnantoni","followers_url":"https://api.github.com/users/johnantoni/followers","following_url":"https://api.github.com/users/johnantoni/following{/other_user}","gists_url":"https://api.github.com/users/johnantoni/gists{/gist_id}","starred_url":"https://api.github.com/users/johnantoni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnantoni/subscriptions","organizations_url":"https://api.github.com/users/johnantoni/orgs","repos_url":"https://api.github.com/users/johnantoni/repos","events_url":"https://api.github.com/users/johnantoni/events{/privacy}","received_events_url":"https://api.github.com/users/johnantoni/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-17T19:39:41Z","updated_at":"2016-10-22T19:27:57Z","closed_at":"2016-10-22T19:27:57Z","body":"Hi, now dispatch_once_t is unavailable in Swift 3 how would you recommend replacing it?\r\n\r\nXCode suggests using lazily initialized globals, what would be a recommended replacement?\r\n\r\n```\r\n    override class func initialize() {\r\n        struct Static {\r\n            static var onceToken : dispatch_once_t = 0;\r\n        }\r\n        dispatch_once(&Static.onceToken) {\r\n            self.registerSubclass()\r\n        }\r\n    }\r\n\r\n```\r\n\r\nNow looking at this post http://stackoverflow.com/questions/33069650/parse-com-subclassing-in-swift-2 it suggests registering the SubClass within AppDelegate:\r\n\r\n```\r\nAppdelegate.swift\r\n....\r\nFoobar.registerSubclass()\r\n\r\n```\r\n\r\nSo if I register the subclass in AppDelegate do I even need to include the initialize block inside the subclass? removing the problem with dispatch_once.\r\n\r\nWhat do you think or is this crazy?\r\n\r\nAppreciate it,"}}
{"actor":{"display_login":"johnantoni"}}