Contents

CFRunLoopAddObserver(_:_:_:)

Adds a CFRunLoopObserver object to a run loop mode.

Declaration

func CFRunLoopAddObserver(_ rl: CFRunLoop!, _ observer: CFRunLoopObserver!, _ mode: CFRunLoopMode!)

Parameters

  • rl:

    The run loop to modify.

  • observer:

    The run loop observer to add.

  • mode:

    The run loop mode to which to add observer. Use the constant Commonmodes to add observer to the set of objects monitored by all the common modes.

Discussion

A run loop observer can be registered in only one run loop at a time, although it can be added to multiple run loop modes within that run loop.

If rl already contains observer in mode, this function does nothing.

See Also

Managing Observers