DropletNotification
A notification a droplet posts into Droppy's banner stack (1.23.0).
struct DropletNotification
Data only: Droppy draws the row with its own banner layout, avatar, type and buttons, exactly as it draws a notification from any app. The leading image is your droplet's icon unless you name an SF Symbol, which Droppy draws on a tile in the icon's place.
Available from DroppyKit 1.23.0.
Initializers
init(id:threadID:title:body:systemImage:actions:)
init(id: String, threadID: String? = nil, title: String, body: String? = nil, systemImage: String? = nil, actions: [DropletNotificationAction] = [])
Creates a notification.
Properties
actions
let actions: [DropletNotificationAction]
Up to two buttons under the row. Droppy draws the first two and ignores the rest. A click comes back as action(id:actionID:) and takes the row away.
body
let body: String?
The message under the title, or nil. Hidden when the user turned off notification previews.
id
let id: String
Stable id. Posting again with the same id replaces the notification in place, on screen or waiting, the way a follow-up message updates its row.
systemImage
let systemImage: String?
An SF Symbol to draw in the icon's place, or nil for your droplet's icon.
threadID
let threadID: String?
Groups notifications into one row: a second notification with the same thread replaces the row's message and raises its count, the way Droppy stacks a conversation. nil keeps every notification its own row.
title
let title: String
The row's title, one line.