Last active
December 10, 2018 05:12
-
-
Save JaNd3r/6bc6f1fa3deae3d4f607 to your computer and use it in GitHub Desktop.
Attention when moving asynchronously UI-changing code to a background thread: Notifications sent using the `NSNotificationCenter.defaultCenter()` must be sent on the main thread. Otherwise you will receive a warning like this: "This application is modifying the autolayout engine from a background thread, which can lead to engine corruption and w…
This file contains hidden or 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
func postMainThreadNotificationName(name: String, object: AnyObject?, userInfo: [NSObject : AnyObject]?) { | |
dispatch_async(dispatch_get_main_queue(), { | |
NSNotificationCenter.defaultCenter().postNotificationName(name, object: object, userInfo: userInfo) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Complete console log message: