I am converting a project to Swift 3 and am having a similar issue to Swift 3 ObjC Optional Protocol Method Not Called in Subclass for the Core Bluetooth peripheral methods.
Instance method 'peripheral(:didDiscoverServices:)' nearly matches optional requirement 'peripheral(:didDiscoverServices:)' of protocol 'CBPeripheralDelegate'
However, when I add the @objc declaration as a workaround, I am getting this error:
Method cannot be marked @objc because the type of the parameter 2 cannot be represented in Objective-C
This is my declaration:
@objc(peripheral:didDiscoverServices:)
func peripheral(_ peripheral: CBPeripheral, didDiscoverServices error: Error?) {
I am using Xcode 8.3.1
Any ideas?