iOS Developer Library

Developer

GameKit Framework Reference GKPeerPickerController Class Reference

Options
Deployment Target:

On This Page
Language:

GKPeerPickerController

The GKPeerPickerController class provides a standard user interface to allow one iOS device to discover and connect to another. The result is a configured GKSession object connecting the two devices. To use a GKPeerPickerController object, your application creates the controller, adds a delegate, configures the allowed connection types, and then shows the peer picker. The delegate is called as the user makes selections within the peer picker interface. More...

Inheritance


Conforms To


Import Statement


import GameKit @import GameKit;

Availability


Available in iOS 3.0 and later.
Deprecated in iOS 7.0.
  • show show (iOS 7.0)

    Displays the peer picker dialog to the user.

    Declaration

    Objective-C

    - (void)show

    Discussion

    On iOS 3.1 or later, the peer picker is retained when it is shown, and autoreleased when it is dismissed.

    Import Statement

    Availability

    Available in iOS 3.0 and later.

    Deprecated in iOS 7.0.

  • dismiss dismiss (iOS 7.0)

    Hides the peer picker dialog.

    Declaration

    Objective-C

    - (void)dismiss

    Discussion

    The controller’s delegate is responsible for dismissing the peer picker when it is no longer needed.

    On iOS 3.1 or later, the peer picker is retained when it is shown, and autoreleased when it is dismissed.

    Import Statement

    Availability

    Available in iOS 3.0 and later.

    Deprecated in iOS 7.0.

  • visible visible (iOS 7.0) Property

    A Boolean value that indicates whether the picker dialog is visible. (read-only)

    Declaration

    Objective-C

    @property(nonatomic, readonly, getter=isVisible) BOOL visible

    Import Statement

    Availability

    Available in iOS 3.0 and later.

    Deprecated in iOS 7.0.

  • A mask that determines the types of connections a dialog presents to the user.

    Declaration

    Objective-C

    @property(nonatomic, assign) GKPeerPickerConnectionType connectionTypesMask

    Discussion

    Your application configures the connection types it allows before showing the peer picker. If your application allows more than one connection type, the peer picker offers the user a choice of which type of connection to use. The default value for the mask is GKPeerPickerConnectionTypeNearby.

    Import Statement

    Availability

    Available in iOS 3.0 and later.

    Deprecated in iOS 7.0.

  • Network connections available to the peer picker dialog.

    Declaration

    Swift

    typealias GKPeerPickerConnectionType = Int

    Objective-C

    enum { GKPeerPickerConnectionTypeOnline = 1 << 0, GKPeerPickerConnectionTypeNearby = 1 << 1 }; typedef NSUInteger GKPeerPickerConnectionType;

    Constants

    • GKPeerPickerConnectionTypeOnline

      GKPeerPickerConnectionTypeOnline

      An Internet-based connection.

      Available in iOS 3.0 and later.

      Deprecated in iOS 7.0.

    • GKPeerPickerConnectionTypeNearby

      GKPeerPickerConnectionTypeNearby

      A Bluetooth connection to a device.

      Available in iOS 3.0 and later.

      Deprecated in iOS 7.0.

    Import Statement

    import GameKit

    Availability

    Available in iOS 3.0 and later.