Contents

waitForDataInBackgroundAndNotify(forModes:)

Asynchronously checks to see if data is available.

Declaration

func waitForDataInBackgroundAndNotify(forModes modes: [RunLoop.Mode]?)

Parameters

  • modes:

    The runloop modes in which the data available notification can be posted.

Discussion

When the data becomes available, this method posts a NSFileHandleDataAvailable notification on the current thread. This method differs from waitForDataInBackgroundAndNotify() in that modes specifies the run-loop mode (or modes) in which NSFileHandleDataAvailable can be posted.

You must call this method from a thread that has an active run loop.

See Also

Reading Asynchronously with Notifications