diff --git a/README.md b/README.md index 9b2694f..edf625a 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,15 @@ manualDismissTrigger.trigger() // Dismiss UINotificationCenter.current.notificationViewType = MyCustomNotificationView.self ``` +### Use a custom UIButton +By setting the `button` property on `UINotification`, you can simply add a button to the notification. + +```swift +notification.button = UIButton(type: .system) +``` + +![Button](Assets/button_notification.png?) + ### Create a custom presenter Create a custom presenter to manage presentation and dismiss animations. diff --git a/Sources/UINotification.swift b/Sources/UINotification.swift index fe55028..31c7088 100644 --- a/Sources/UINotification.swift +++ b/Sources/UINotification.swift @@ -72,6 +72,7 @@ public final class UINotification: Equatable { public let style: UINotificationStyle /// The button to display on the right side of the notification, if any. + /// Setting this property will add the button, even if the notification is already visible. public var button: UIButton? { didSet { delegate?.didUpdateButton(in: self)