Instance Property

title

The localized title, containing the reason for the alert.

Declaration

var title: String { get set }

Discussion

Use this property to specify the title of your notification alert. If your app is not authorized to display alert-based notifications, this property is ignored.

Title strings should be short, usually only a couple of words describing the reason for the notification. In watchOS, the title string is displayed as part of the short look notification interface, which has limited space.

See Also

Getting the Notification Data

var subtitle: String

The localized subtitle, containing a secondary description of the reason for the alert.

var body: String

The localized message to display in the notification alert.

var badge: NSNumber?

The number to apply to the app’s icon.

var sound: UNNotificationSound?

The sound to play when the notification is delivered.

var launchImageName: String

The name of the custom launch image to display when your app is launched in response to the notification.

var userInfo: [AnyHashable : Any]

A dictionary of custom information associated with the notification.

var attachments: [UNNotificationAttachment]

An array of attachments to display in an alert-based notification.