Instance Method


Registers the Apple event handler specified by handler for the event specified by eventClass and eventID.


func setEventHandler(_ handler: Any, andSelector handleEventSelector: Selector, forEventClass eventClass: AEEventClass, andEventID eventID: AEEventID)


If an event handler is already registered for the specified event class and event ID, removes it. The signature for handler should match the following:

- (void)handleAppleEvent:(NSAppleEventDescriptor *)event withReplyEvent: (NSAppleEventDescriptor *)replyEvent;

See Also

Working with event handlers

func removeEventHandler(forEventClass: AEEventClass, andEventID: AEEventID)

If an Apple event handler has been registered for the event specified by eventClass and eventID, removes it.