<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NotificationCenter/post(name:object:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSNotificationCenter(im)postNotificationName:object:"
  },
  "title" : "post(name:object:)"
}
-->

# post(name:object:)

Creates a notification with a given name and sender and posts it to the notification center.

```
func post(name aName: NSNotification.Name, object anObject: Any?)
```

## Parameters

`aName`

The name of the notification.

`anObject`

The object posting the notification.

## Discussion

This is a convenience method for calling [`post(name:object:userInfo:)`](/documentation/Foundation/NotificationCenter/post(name:object:userInfo:)) and passing `nil` to `aUserInfo`.

---

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)