One Logo Pool Ball
GameController · IOS API REFERENCE

GCController.DidBecomeCurrentMessage

struct · iOS 26.0+ · SDK 27.1

struct DidBecomeCurrentMessage

A message that posts after a game controller becomes the most recently used controller. This is a good time to swap out UI to match the new current controller, and unregister any handlers with the old current controller. Use the `.didBecomeCurrent` identifier with `NotificationCenter` to listen for this message. ``` let observation = NotificationCenter.default.addObserver(of: GCController.self, for: .didBecomeCurrent) { message in let controller = message.controller } ```

Members (5)

static · iOS 26.0+

makeMessage

TypeScript
static makeMessage(notification: _Foundation_Notification): Promise<(GCController_DidBecomeCurrentMessage) | null>
Swift declaration
@MainActor static func makeMessage(_ notification: Notification) -> GCController.DidBecomeCurrentMessage?

Converts a posted notification into this main actor message type for any observers. To implement this method in your own `MainActorMessage` conformance, retrieve values from the ``Notification``'s ``Notification/userInfo`` and set them as properties on the message. - Parameter notification: The posted ``Notification``. - Returns: The converted `MainActorMessage` or `nil` if conversion is not possible.

get · iOS 26.0+

controller

TypeScript
get controller(): GCController
Swift declaration
var controller: GCController

The controller object that became current.

set · iOS 26.0+

controller

TypeScript
set controller(value: GCController)
Swift declaration
var controller: GCController

The controller object that became current.

init · iOS 26.0+

init

TypeScript
static init(controller: GCController): GCController_DidBecomeCurrentMessage
Swift declaration
init(controller: GCController)
get · iOS 26.0+

name

TypeScript
static get nameValue(): _Foundation_NSNotification_Name
Swift declaration
static var name: Notification.Name { get }

A optional name corresponding to this type, used to interoperate with notification posters and observers.

Skipped declarations

No declarations were skipped in this snapshot.

All GameController types →