简体   繁体   中英

How to customize a GKMatchmakerViewController

I want to create a custom GKMatchMakerViewController

Code with the standard ViewController (colorful bubbles):

 if([GKLocalPlayer localPlayer].isAuthenticated){
        GKMatchRequest *request = [[GKMatchRequest alloc] init] ;
        request.minPlayers = 2;
        request.maxPlayers = 2;
        GKMatchmakerViewController *MM = [[GKMatchmakerViewController alloc] initWithMatchRequest:request];
        MM.matchmakerDelegate = self;
     [self presentViewController:mmvc animated:YES completion:nil];

You need to create a custom view controller from scratch. Then you load your matches using loadMatchesWithCompletionHandler: method. Then you can present your matches on your controller, for example using a UITableView . See GKTurnBasedMatch Class Reference for more information.

将MM(在2个地方)更改为mmvc或将mmvc(在一个地方)更改为MM

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM