Skip to content

Latest commit

 

History

History
41 lines (36 loc) · 1.19 KB

README.md

File metadata and controls

41 lines (36 loc) · 1.19 KB

SwiftyNotifications

Easy to use in app notification library for your app.

demobf322ea4fc483576.gif

Usage

let notification = NotificationBuilder
            .setTheme(NotificationType.error)
            .setTitle("💀 Error")
            .setSubtitle("Something bad happened")
            .isDismissable()
            .setPrimaryButton(text: "Report", action: {})
            .setSecondaryButton(text: "Close", action: {})
            .setTimeout(20_000)
            .showIcon()
            .setCompletionHandler(completion: { (type) in
                switch type{
                case .closeTapped:
                    // action
                    break
                case .primaryButtonTapped:
                    // action
                    break
                case .secondaryButtonTapped:
                    // action
                    break
                case .timeoutReached:
                    // action
                    break
                case .swipeUp:
                    // action
                    break
                }
            })
            .build()

notification.show()