func session(_ session: WCSession, didReceiveMessage message: [String : AnyObject]
,replyHandler: ([String : AnyObject]) -> Void
){
print("Message received ")
replyHandler(["Value":"Yes" as AnyObject])
}
得出warning
的结果:
Instance method 'session(_:didReceiveMessage:replyHandler:)' nearly matches optional requirement 'session(_:didReceiveMessage:replyHandler:)' of protocol 'WCSessionDelegate'
Candidate has non-matching type '(WCSession, [String : AnyObject], ([String : AnyObject]) -> Void) -> ()'
Xcode 9.4.1
我在许多示例中都看到过code
这个建议,但对我来说却失败了。有什么想法吗?