Are there new notifications that currently don't work in Swift 3? I do:
NotificationCenter.default().post(name: DidTouchParticleView, object: self.particle as? AnyObject)
in the user view touchhesBegan (), and I need to send the particle object to the view controller, if any. So I do this:
NotificationCenter.default().addObserver(forName: DidTouchParticleView, object: self, queue: OperationQueue.main(), using: presentParticleDisplayView(notification:))
in the controller view viewDidLoad (). I am sure that this particular view controller is the one that was presented when I clicked on my custom view, however the presentParticleDisplayView(notification:) function is never called.
In addition, DidTouchParticleView is defined globally as follows:
let DidTouchParticleView = NSNotification.Name("didTouchParticleView")
Is it because of the beta, or am I doing something wrong?
ios swift3 beta nsnotification
Youssef moawad
source share