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
sessionIDshould be the short name of an approved Bonjour service type. Ifnil, the session uses the application’s bundle identifier to create asessionIDstring. - 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.