---
title: "init(name:object:userInfo:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsnotification/init(name:object:userinfo:)"
---

# init(name:object:userInfo:)

Initializes a notification with a specified name, object, and user information.

## Declaration

```swift
init(name: NSNotification.Name, object: Any?, userInfo: [AnyHashable : Any]? = nil)
```

## Parameters

- `name`: The name for the new notification. May not be nil.
- `object`: The object for the new notification.
- `userInfo`: The user information dictionary for the new notification. May be nil.

## See Also

### Creating Notifications

- [init(coder:)](foundation/nsnotification/init(coder:).md)
- [init(name:object:)](foundation/nsnotification/init(name:object:).md)
- [NSNotification.Name](foundation/nsnotification/name-swift.struct.md)
