This was my code in 2.2 and I want this this to happen only once of an appliation cycle. But in swift 3 we do similar kind of stuff using gloabal static variable.
But the problem is that I can't access ivar from that closure, can anybody has some idea how to achieve this?
static private var token: dispatch_once_t = 0
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
dispatch_once(&DashboardViewController.token) {
self.myIvar = something;
}
}