---
title: "post(name:object:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/distributednotificationcenter/post(name:object:)"
---

# post(name:object:)

Creates a notification, and posts it to the receiver.

## Declaration

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

## Parameters

- `aName`: Name of the notification to post. Must not be nil.
- `anObject`: Sender of the notification. May be nil.

## Discussion

Discussion This method invokes postNotificationName(_:object:userInfo:deliverImmediately:) with userInfo:nil deliverImmediately:NO.

## See Also

### Posting Notifications

- [post(name:object:userInfo:)](foundation/distributednotificationcenter/post(name:object:userinfo:).md)
- [postNotificationName(_:object:userInfo:deliverImmediately:)](foundation/distributednotificationcenter/postnotificationname(_:object:userinfo:deliverimmediately:).md)
- [postNotificationName(_:object:userInfo:options:)](foundation/distributednotificationcenter/postnotificationname(_:object:userinfo:options:).md)
