See Why in swift we cannot adopt a protocol without inheritance a class from NSObject?
In short, WCSessionDelegate
itself inherits from NSObjectProtocol
therefore you need to implement methods in that protocol, too. The easiest way to implement those methods is to subclass NSObject
:
class BatteryLevel: NSObject, WCSessionDelegate
Note that you are dealing with Obj-C APIs here.
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