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

# post(name:object:)

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

## Declaration

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

## Parameters

- `aName`: The name of the notification.
- `anObject`: The object posting the notification.

## Discussion

Discussion This is a convenience method for calling post(name:object:userInfo:) and passing nil to aUserInfo.

## See Also

### Posting notifications

- [post(_:)](foundation/notificationcenter/post(_:)-3x2st.md)
- [post(name:object:userInfo:)](foundation/notificationcenter/post(name:object:userinfo:).md)
