i have this function in my code:
func match(match: GKMatch, player playerID: String, didChangeState state: GKPlayerConnectionState) {
if (match != self.match) {
print("Wrong match")
return
}
and it gaves me this warning:
Instance method 'match(match:player:didChangeState:)' nearly matches optional requirement 'match(_:player:didChange:)' of protocol 'GKMatchDelegate'
and it offers me the possibility to make the func private, or to insert @nonobjc to silence the warning? what should i do?
答案 0 :(得分:0)
好的,感谢https://stackoverflow.com/users/1187415/martin-r(和文档) 只需将其更改为:
func match(_ match: GKMatch, player playerID: String, didChange state: GKPlayerConnectionState) {
if (match != self.match) {
print("Wrong match")
return
}