2015-05-05 8 views
2

我想創建一個自定義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]; 

回答

0

您需要從頭開始創建一個自定義視圖控制器。然後你使用loadMatchesWithCompletionHandler:方法加載你的匹配。然後,您可以在控制器上顯示您的匹配,例如使用UITableView。有關更多信息,請參閱GKTurnBasedMatch Class Reference