You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SR-6419] NotificationCenter.addObserver of SCLF with trailing closure syntax cannot be used on Swift 4.0.2 #3786
In Swift 4.0.2 NotificationCenter.addObserver(forName:object:queue:usingBlock🙂 is renamed to addObserver(forName:object:queue:using🙂 and the old API is kept as an obsoleted API. The obsoleted symbol makes it ambiguous to use the API with trailing closure syntax:
Activity
belkadan commentedon Nov 17, 2017
@phausler There was a dup of this for macOS, right?
ikesyo commentedon Nov 23, 2017
@available(*, obsoleted: 4.0)is not appropriate and@available(swift, obsoleted: 4.0)should be used instead.ikesyo commentedon Nov 23, 2017
I was requested to use
@available(*, unavailable)instead of@available(swift, obsoleted: 4.0).ikesyo commentedon Nov 23, 2017
So the actual issue here is
@available(*, obsoleted: 4.0)means iOS 4.0, macOS 4.0, tvOS 4.0, watchOS 4.0 and does not mean Swift 4.0.belkadan commentedon Nov 27, 2017
That's hilarious. We should definitely be rejecting that!
alblue commentedon Nov 28, 2017
This has been merged into the master branch, which should be part of the 4.1 release.