Created
November 1, 2016 13:38
-
-
Save owenzhao/e35d56be8f52a7ef0c74b6ad21ceac87 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() | |
Timer.scheduledTimer(timeInterval: 0.1, target: self, selector: #selector(sendNotification), userInfo: nil, repeats: false) | |
} | |
func sendNotification() { | |
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