Skip to content

Commit

Permalink
Improve documentation for new Button feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Boris-Em committed Mar 11, 2020
1 parent 4ddd45e commit 5490cbf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
1 change: 1 addition & 0 deletions Sources/UINotification.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5490cbf

Please sign in to comment.