Reputation: 11
I end the turn like this , but i want to give an time-out for searching for player , issue that i'm having is turnTimeout only works for active players , but not working for status "matching" . Is there another way to stop matchmaking after a give time ? please help me out . thanks
currentMatch.endTurn(withNextParticipants: [nextParticipant],
turnTimeout: 15.0, match: data!) { (error) in
if ((error) != nil) {
print("Error Oops, there was a problem. Try that
again.",error!)
}
}
statusLabel.text = "Game has ended"
}
Upvotes: 1
Views: 176
Reputation: 4177
GKTurnbasedMatch
does not provide any way to do that. But, you can set your own NSTimer. If the timer fires and you haven't found an opponent, you can leave the match.
Upvotes: 1