I just converted a Swift 2 app to Swift 3, using the convert function of Xcode 8.
My code has a class marked as WCSessionDelegate
.
In Swift 2 it compiled without the methods sessionDidBecomeInactive
and sessionDidDeactivate
.
If I compile the Swift 3 version, the compiler complains that my class does not conform to protocol WCSessionDelegate
, which is apparently correct.
It then offers to insert stubs for both functions:
public func sessionDidBecomeInactive(_ session: WCSession) { }
public func sessionDidDeactivate(_ session: WCSession) { }
After these stubs are inserted, these errors are reported:
Cannot override 'sessionDidBecomeInactive' which has been marked unavailable
Cannot override 'sessionDidDeactivate' which has been marked unavailable
How can I fix this problem?
deactivate
andinactive
callbacks; is it compiled and used for both the iOS app and WatchKit extension? – Mohamedmohammad