A message the system sends when a port becomes invalid.
A ``SocketPort`` object can't detect when its connection to a remote port is lost, even if the remote port is on the same machine.
Therefore, it can't invalidate itself and post this message.
Instead, your app needs to detect the timeout error when sending the next message.
The ``Port`` object sending this message is no longer useful, so all receivers should unregister themselves for any notifications involving the port.
The handler that receives this message should check to see which port became invalid before attempting to do anything.
In particular, observers that receive all `DidBecomeInvalidMessage` instances should be aware that the system handles communication with the window server through a `Port`.
If this port becomes invalid, drawing operations cause a fatal error.
Observe this message with the identifier ``NotificationCenter/MessageIdentifier/didBecomeInvalid``, or specify its type directly to the `addObserver(of:for:using:)` method.
The ``NotificationCenter/MainActorMessage/Subject`` of this message type is ``Port``.
This message interoperates with the notification ``Port/didBecomeInvalidNotification``.
The system notifies observers of the message when the ``NotificationCenter`` posts the notification.
Similarly, the system notifies observers of the notification when it posts the message.
Converts a posted notification into this asynchronous message type for any observers.
To implement this method in your own `AsyncMessage` 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 `AsyncMessage`, or `nil` if conversion is not possible.
get · iOS 26.0+
name
TypeScript
static get nameValue(): 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.
init · iOS 26.0+
init
TypeScript
static init(): Port_DidBecomeInvalidMessage
Swift declaration
init()
Creates a message that indicates a port became invalid.