I have some code that I would like to run only once in my MainViewController. It should run every time the user starts the app, but only after the MainViewController has loa
for Swift2.2,Xcode 7.3:
static var token: dispatch_once_t = 0 dispatch_once(&YourClassName.token) { NSLog("Do it once") }
Watch out "YourClassName.token"
YourClassName.token