Skip to content

Easy to use in-app notification library based on the builder pattern

Notifications You must be signed in to change notification settings

nireinhard/SwiftyNotifications

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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()

About

Easy to use in-app notification library based on the builder pattern

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published