I found the following code snippet which allows NSNotification to be posted on the main thread from any background thread. I would like to know if this is a saf
YES
Swift 2 syntax
dispatch_async(dispatch_get_main_queue()) {
NSNotificationCenter.defaultCenter().postNotificationName("updateSpinner", object: nil, userInfo: ["percent":15])
}
Swift 3 syntax
DispatchQueue.main.async {
NotificationCenter.default.post(name: "updateSpinner", object: nil, userInfo: ["percent":15])
}