swift - Type 'Battle' does not conform to protocol 'GKMatchmakerViewControllerDelegate' -
i have code:
import gamekit class battle: uiviewcontroller, gkmatchmakerviewcontrollerdelegate { func hostmatch(sender: anyobject) { var request: gkmatchrequest = gkmatchrequest() request.minplayers = 2 request.maxplayers = 2 var mmvc: gkmatchmakerviewcontroller = gkmatchmakerviewcontroller(matchrequest: request)! mmvc.matchmakerdelegate = self self.presentviewcontroller(mmvc, animated: true, completion: { _ in }) } }
which should show game center standard user interface searching players, reason keeps giving me error:
type 'battle' not conform protocol 'gkmatchmakerviewcontrollerdelegate'
that whole error , have no idea how fix it. if have answer, please explain can understand it.
you getting error because class doesn't have functions (or variables) protocol gkmatchkmakerviewcontrollerdelegate wants class have.
to find out functions or variables need include, command-click on protocol name. see protocol declaration. normal functions listed there are required inside class.
Comments
Post a Comment