简体   繁体   中英

Is it possible to remove the "Invite Friends" Button from Game Center Built in interface?

For my project (a multiplayer game) in Objective-C, I have implemented the built-in matchmaking user interface for Game Center following guidelines from Ray Wenderlich tutorials:

https://www.raywenderlich.com/2487-game-center-tutorial-how-to-make-a-simple-multiplayer-game-with-sprite-kit-part-1-2

However, I'm interested in the "Play Now" feature only and I don't want to implement the "Invite Friends" button.

Is there any easy way to remove this button from the interface ?

You cannot change the GKMatchMakerViewController, it's an Apple User Interface that can't be interfered with. If you want to disable the option to invite friends, then you can programatically create MatchMaking.

To programmatically search for other players, start by creating a GKMatchRequest object that describes the match you are interested in. Then, call the shared matchmaker's findMatch(for:withCompletionHandler:)

Use this documentation from Apple to help guide you through steps for programatically MatchMaking: https://developer.apple.com/documentation/gamekit/gkmatchmaker

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