繁体   English   中英

如何自定义GKMatchmakerViewController

[英]How to customize a GKMatchmakerViewController

我想创建一个自定义的GKMatchMakerViewController

使用标准ViewController编码(彩色气泡):

 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];

您需要从头开始创建自定义视图控制器。 然后,使用loadMatchesWithCompletionHandler:方法加载匹配loadMatchesWithCompletionHandler: 然后,您可以在控制器上显示匹配项,例如使用UITableView 有关更多信息,请参见GKTurnBasedMatch类参考

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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