Class: GKMatchmakerViewController

Inherits:
UINavigationController show all

Overview

The GKMatchmakerViewController class is used to present a standard user interface to the player. This interface allows them to invite friends to a match or to allow Game Center to fill the remaining players needed for a match.

Instance Attribute Summary (collapse)

Attributes inherited from UINavigationController

#delegate, #navigationBar, #navigationBarHidden, #toolbar, #toolbarHidden, #topViewController, #viewControllers, #visibleViewController

Attributes inherited from UIViewController

#childViewControllers, #contentSizeForViewInPopover, #definesPresentationContext, #editing, #hidesBottomBarWhenPushed, #interfaceOrientation, #modalInPopover, #modalPresentationStyle, #modalTransitionStyle, #navigationController, #navigationItem, #nibBundle, #nibName, #parentViewController, #presentedViewController, #presentingViewController, #providesPresentationContextTransitionStyle, #restorationClass, #restorationIdentifier, #searchDisplayController, #splitViewController, #storyboard, #tabBarController, #tabBarItem, #title, #toolbarItems, #view, #wantsFullScreenLayout

Attributes inherited from UIResponder

#inputAccessoryView, #inputView, #undoManager

Instance Method Summary (collapse)

Methods inherited from UINavigationController

#initWithNavigationBarClass:toolbarClass:, #initWithRootViewController:, #popToRootViewControllerAnimated:, #popToViewController:animated:, #popViewControllerAnimated:, #pushViewController:animated:, #setNavigationBarHidden:animated:, #setToolbarHidden:animated:, #setViewControllers:animated:

Methods inherited from UIViewController

#addChildViewController:, attemptRotationToDeviceOrientation, #beginAppearanceTransition:animated:, #canPerformUnwindSegueAction:fromViewController:withSender:, #decodeRestorableStateWithCoder:, #didMoveToParentViewController:, #didReceiveMemoryWarning, #didRotateFromInterfaceOrientation:, #disablesAutomaticKeyboardDismissal, #dismissViewControllerAnimated:completion:, #editButtonItem, #encodeRestorableStateWithCoder:, #endAppearanceTransition, #initWithNibName:bundle:, #isBeingDismissed, #isBeingPresented, #isMovingFromParentViewController, #isMovingToParentViewController, #isViewLoaded, #loadView, #performSegueWithIdentifier:sender:, #preferredInterfaceOrientationForPresentation, #prepareForSegue:sender:, #presentViewController:animated:completion:, #removeFromParentViewController, #rotatingFooterView, #rotatingHeaderView, #segueForUnwindingToViewController:fromViewController:identifier:, #setEditing:animated:, #setToolbarItems:animated:, #shouldAutomaticallyForwardAppearanceMethods, #shouldAutomaticallyForwardRotationMethods, #shouldAutorotate, #shouldPerformSegueWithIdentifier:sender:, #supportedInterfaceOrientations, #transitionFromViewController:toViewController:duration:options:animations:completion:, #updateViewConstraints, #viewControllerForUnwindSegueAction:fromViewController:withSender:, #viewDidAppear:, #viewDidDisappear:, #viewDidLayoutSubviews, #viewDidLoad, #viewWillAppear:, #viewWillDisappear:, #viewWillLayoutSubviews, #willAnimateRotationToInterfaceOrientation:duration:, #willMoveToParentViewController:, #willRotateToInterfaceOrientation:duration:

Methods inherited from UIResponder

#becomeFirstResponder, #canBecomeFirstResponder, #canPerformAction:withSender:, #canResignFirstResponder, #isFirstResponder, #motionBegan:withEvent:, #motionCancelled:withEvent:, #motionEnded:withEvent:, #nextResponder, #reloadInputViews, #remoteControlReceivedWithEvent:, #resignFirstResponder, #touchesBegan:withEvent:, #touchesCancelled:withEvent:, #touchesEnded:withEvent:, #touchesMoved:withEvent:

Methods inherited from NSObject

#!, #!=, #!~, #, #==, #===, #=~, #Rational, #__callee__, #__method__, #__send__, #__type__, `, alloc, allocWithZone:, #autoContentAccessingProxy, autoload, autoload?, autorelease_pool, #awakeAfterUsingCoder:, binding, block_given?, caller, cancelPreviousPerformRequestsWithTarget:, cancelPreviousPerformRequestsWithTarget:selector:object:, catch, class, classFallbacksForKeyedArchiver, #classForCoder, #classForKeyedArchiver, classForKeyedUnarchiver, #clone, conformsToProtocol:, #copy, copyWithZone:, #dealloc, #define_singleton_method, description, display, #doesNotRecognizeSelector:, #dup, #enum_for, #eql?, #equal?, #extend, fail, #finalize, format, #forwardInvocation:, #forwardingTargetForSelector:, framework, #freeze, #frozen?, getpass, gets, global_variables, #init, initialize, #initialize_clone, #initialize_copy, #initialize_dup, #inspect, instanceMethodForSelector:, instanceMethodSignatureForSelector:, #instance_eval, #instance_exec, #instance_of?, #instance_variable_defined?, #instance_variable_get, #instance_variable_set, #instance_variables, instancesRespondToSelector:, isSubclassOfClass:, #is_a?, iterator?, #kind_of?, lambda, load, load_bridge_support_file, load_plist, local_variables, loop, #method, #methodForSelector:, #methodSignatureForSelector:, #methods, #mutableCopy, mutableCopyWithZone:, new, #nil?, open, p, #performSelector:onThread:withObject:waitUntilDone:, #performSelector:onThread:withObject:waitUntilDone:modes:, #performSelector:withObject:afterDelay:, #performSelector:withObject:afterDelay:inModes:, #performSelectorInBackground:withObject:, #performSelectorOnMainThread:withObject:waitUntilDone:, #performSelectorOnMainThread:withObject:waitUntilDone:modes:, print, printf, #private_methods, proc, #protected_methods, #public_method, #public_methods, #public_send, putc, puts, raise, rand, readline, readlines, #replacementObjectForCoder:, #replacementObjectForKeyedArchiver:, require, resolveClassMethod:, resolveInstanceMethod:, #respond_to?, #respond_to_missing?, select, #send, setVersion:, #singleton_methods, sprintf, srand, superclass, #taint, #tainted?, #tap, test, throw, #to_plist, #to_s, trace_var, trap, #trust, #untaint, untrace_var, #untrust, #untrusted?, version

Constructor Details

This class inherits a constructor from NSObject

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class NSObject

Instance Attribute Details

- (String) defaultInvitationMessage

The default invitation message used to initialize an invitation. Your game sets this property to change the default invitation text displayed when the local player creates a new invitation. The local player may edit the text before sending the invitation.

Returns:

- (Boolean) hosted

A Boolean value that indicates whether the match is hosted or peer-to-peer. The value of the hosted property determines which methods of the delegate are called when the match is complete. If YES, this is a hosted match, and the delegate’s matchmakerViewController:didFindPlayers method is to provide the list of players to your game. If NO, this is a peer-to-peer match, and matchmakerViewController:didCreateMatch is called with a GKMatch object. The default value is NO.Hosted matches require you to provide a server that hosts the participants in the match. For more information on implementing hosted matches, see “Multiplayer”.

Returns:

  • (Boolean)

- (Object) matchmakerDelegate

The delegate for the matchmaker view controller. A delegate is required to receive feedback when the match is created.

Returns:

- (GKMatchRequest) matchRequest (readonly)

The configuration for the desired match. (read-only)

Returns:

Instance Method Details

- (Object) addPlayersToMatch(match)

Your game calls this method prior to presenting the view controller to the player. Calling this method instructs the view controller to add new players to the provided match rather than creating a new match.When called, this method sets the delegate on the match to nil and updates the view controller’s user interface to display the players already connected to the match.Important: Only one device connected to the match should call this method.

Parameters:

  • match (GKMatch)

    An existing match that you want to add players to.

Returns:

- (Object) initWithInvite(invite)

Initializes a matchmaker view controller to respond to an invitation received from another player. The user is allowed to join the match that the user was invited to, but is not allowed to invite others to the match.

Parameters:

  • invite (GKInvite)

    The invitation received from the other player.

Returns:

  • (Object)

    An initialized matchmaker view controller object. If an error occurred, NULL is returned.

- (Object) initWithMatchRequest(request)

Initializes a matchmaker view controller to create a new match. Your game uses the initWithMatchRequest: method when it wants the local user to create a new match.

Parameters:

  • request (GKMatchRequest)

    A request containing the characteristics for the desired match.

Returns:

  • (Object)

    An initialized matchmaker view controller object. If an error occurred, NULL is returned.

- (Object) setHostedPlayer(playerID, connected:connected)

Updates a player’s status on the view to show that the player has connected or disconnected from your server. When setting up a hosted match, each device should instantiate a matchmaker view controller and display it to the player. Then, when a new player connects to your server, your server should notify all participating devices already connected to your server. Each participating device should then call this method to update that player’s status in the matchmaking interface. Similarly, if a player disconnects from the server, your server should inform each device so that the devices can update their user interface.

Parameters:

  • playerID (String)

    The identifier string for a player that connected to the external server.

  • connected (Boolean)

    A Boolean value that states whether the player is connected to the hosted match.

Returns: