Initializer

init(sessionID:displayName:sessionMode:)

Initializes and returns a newly allocated session.

Declaration

init!(sessionID: String!, displayName name: String!, sessionMode mode: GKSessionMode)

Parameters

sessionID

A unique string that identifies your application. Your sessionID should be the short name of an approved Bonjour service type. If nil, the session uses the application’s bundle identifier to create a sessionID string.

name

A string identifying the user to display to other peers. If nil, the session uses the device name.

mode

The mode the session should run in. See GKSessionMode for possible values.

Return Value

An initialized session object, or nil if an error occurred.

Discussion

Only sessions running with the same sessionID are visible to your session.

See Also

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software