Skip to content

Instantly share code, notes, and snippets.

@romaonthego
Forked from calebd/ArrayHelpers.swift
Created June 4, 2014 19:24
Show Gist options
  • Save romaonthego/a4cb37195b8cab7f68b5 to your computer and use it in GitHub Desktop.
Save romaonthego/a4cb37195b8cab7f68b5 to your computer and use it in GitHub Desktop.
class AccountStore {
// Doesn't work yet
class var sharedStore = ACAccountStore()
// This works although I'm unsure of the optional
class func sharedStore() -> ACAccountStore {
var store: ACAccountStore? = nil
var token: dispatch_once_t = 0
dispatch_once(&token, {
store = ACAccountStore()
})
return store!
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment