Only use Automatch in Gamecenter
Asked Answered
C

2

6

How do you remove the invite friend button from a GKMatchmakerViewController?

When printing all of the subviews in it I only see the navigation bar.

I am presenting it like this:

GKMatchmakerViewController *mmvc = [[GKMatchmakerViewController alloc] initWithMatchRequest:request];

mmvc.matchmakerDelegate = self;

[viewController presentViewController:mmvc animated:YES completion:nil];
Crural answered 1/6, 2015 at 7:4 Comment(0)
C
1

Unfortunately it isn't possible, i looked into removing the quick match button myself and found it couldn't be done.

You can however set up your own custom invite screen, check out the 'Implementing a Custom Match User Interface' section in the 'Real Time Matches' section of the iOS documentation. There are too many code examples to show here I'll just have to supply the description and link:

https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/GameKit_Guide/Matchmaking/Matchmaking.html

DESCRIPTION

Implementing a complete custom match interface can be as simple as displaying a network progress indicator until auto-matching completes, or as sophisticated as implementing a complete custom view controller that replicates the standard behavior. The latter is potentially a significant investment in programming time, as it needs to include support for all of the following:

  • Inviting specific players into a match
  • Listening for responses from invited players
  • Looking for nearby players (available via Wi-Fi or Bluetooth)
Conium answered 23/6, 2015 at 11:27 Comment(0)
H
0

You can remove the ‘Invite Friends’ button by using the restrictToAutomatch property.

let request = GKMatchRequest()
request.restrictToAutomatch = true

Sadly, there is no restrictToInviteFriends.

Honesty answered 16/8, 2020 at 12:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.