I converted my (macOS) project to Swift 3 in Xcode 8 and I get the following warnings with several delegate methods I implement in swift classes:
Instance method 'someMethod' nearly matches optional requirement of protocol 'protocolName'
I get this for several NSApplicationDelegate methods like applicationDidFinishLaunching
and applicationDidBecomeActive
:
But also for implementations of tableViewSelectionDidChange
:
I used code completion to insert the method signatures and also tried copying them from the SDK-headers to rule out typos. The warnings just don't disappear and the methods are never called.
What am I missing here?
We contacted Apple Developer Technical Support (DTS) with this issue. They replied that this is a bug in Xcode 8.
We submitted a bug report and hope for a quick update. (Apple Bug Report ID: 28315920).
If you experience a similar issue, please also file a bug report (referring to ours) so the Apple engineers see its not a single case.
Update for Xcode ≥ 8.1
The problem seems fixed now, at least for the delegate methods we are using in our project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With