AXObserverGetRunLoopSource(_:)
Returns the observer's run loop source.
Declaration
func AXObserverGetRunLoopSource(_ observer: AXObserver) -> CFRunLoopSourceParameters
- observer:
The observer object (created from a call to 1460133 Axobservercreate) for which to get the run loop source.
Return Value
Returns the CFRunLoopSourceRef of the observer; NIL if you pass NIL in observer.
Discussion
The observer must be added to a run loop before it can receive notifications. Note that releasing the AXObserverRef automatically removes the run loop source from the run loop (you can also do this explicitly by calling CFRunLoopRemoveSource(_:_:_:)).
AXObserverGetRunLoopSource might be used in code in this way:
CFRunLoopAddSource(CFRunLoopGetCurrent(), AXObserverGetRunLoopSource(observer), kCFRunLoopDefaultMode);