Class does not conform NSObjectProtocol [duplicate] Class does not conform NSObjectProtocol [duplicate] swift swift

Class does not conform NSObjectProtocol [duplicate]


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.