<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSApplication/postEvent(_:atStart:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSApplication(im)postEvent:atStart:"
  },
  "title" : "postEvent(_:atStart:)"
}
-->

# postEvent(_:atStart:)

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

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

## Parameters

`event`

The event object to post to the queue.

`atStart`

Specify <doc://com.apple.documentation/documentation/Swift/true> to add the event to the front of the queue; otherwise, specify <doc://com.apple.documentation/documentation/Swift/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)