Contents

postEvent(_:atStart:)

Adds a given event to the receiver’s event queue.

Declaration

func postEvent(_ event: NSEvent, atStart: Bool)

Parameters

  • event:

    The event object to post to the queue.

  • atStart:

    Specify True to add the event to the front of the queue; otherwise, specify False to add the event to the back of the queue.

Discussion

This method can also be called in subthreads. Events posted in subthreads bubble up in the main thread event queue.

See Also

Managing the event loop