One Logo Pool Ball
Foundation · IOS API REFERENCE

FileHandle.DataAvailableMessage

struct · iOS 26.0+ · SDK 27.1

struct DataAvailableMessage

A message a file handle sends when it determines data is available for reading from a file or communications channel. Before adding an observer for this message type, call either ``FileHandle/waitForDataInBackgroundAndNotify()`` or ``FileHandle/waitForDataInBackgroundAndNotify(forModes:)`` on an appropriate ``FileHandle`` object. Observe this message with the identifier ``NotificationCenter/MessageIdentifier/dataAvailable``, or specify its type directly to the `addObserver(of:for:using:)` method. The ``NotificationCenter/MainActorMessage/Subject`` of this message type is ``FileHandle``. This message interoperates with the notification ``NSNotification/Name/NSFileHandleDataAvailable``. 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.

Members (3)

static · iOS 26.0+

makeMessage

TypeScript
static makeMessage(notification: Notification): (FileHandle_DataAvailableMessage) | null
Swift declaration
static func makeMessage(_ notification: Notification) -> FileHandle.DataAvailableMessage?

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(): FileHandle_DataAvailableMessage
Swift declaration
init()

Creates a message that indicates a file handle has data available for reading.

Skipped declarations

No declarations were skipped in this snapshot.

All Foundation types →