Created
November 1, 2016 13:45
-
-
Save owenzhao/c989324562964828cf007ec00389e7d1 to your computer and use it in GitHub Desktop.
use delay to run away from UserDefaults' bug
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TableViewController: NSViewController, NSTableViewDelegate { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do view setup here. | |
run() | |
DispatchQueue.main.asyncAfter(wallDeadline: .now() + .milliseconds(100)) { [unowned self] () -> () in | |
NotificationCenter.default.post(name: TableViewControllerDidAppear, object: self) | |
} | |
} | |
func run() { | |
// do things | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment