- Unified queue for all alerts
-
Alert.tintColor
-
Alert
with custom actions - wait before & after alert
-
enqueue()
&present()
-
ignored()
- Alerts with
conditions
- several alerts queues
- Action sheets
Simple alert:
Alert.alert(title: "Super popup", message: "Description")
.addCompletion { /* alert disappers */ }
.present()
Dialog with custom action:
Alert.dialog(
title: "Are you sure you want delete it?",
cancelTitle: "No"
actionTitle: "Delete",
isDestructive: true,
actionClosure: { /* remove smth */ }).enqueue()
Every alert has isDispatchable
property which can describe alert behaviour in case if other alert is already presented on screen.
Dispatchable alert will be putten in queue and will presented on screen after all alerts before it.
Not dispatchable alerts will just ignored if queue already has some alerts.
You can configure alert dispatching with dispatchable(Bool)
method and then call dispatch()
.
Or you can explicitly call enqueue()
presentng alert now or later, or present
for just presentng now or never.
- you can set
waitOnAppear(TimeInterval)
andwaitOnDisapper(TimeInterval)
delay in seconds. ignored()
method just ignore this alert at all.- with
addCondition(_ condition: @escaping () -> Bool)
you can specify custom condition for alert. Will be asked before presenting.
- You can add as many completion handlers as you want by
addCompletion
method. Your completion will be called by FIFO rule. onCompletion
method just rewrites all completion handlers with new one.
- Swift 4+
- xCode 9+
- iOS 8.0+
Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.
You can install Carthage with Homebrew using the following command:
$ brew update
$ brew install carthage
To integrate NumberPad into your Xcode project using Carthage, specify it in your Cartfile
:
github "OlegKetrar/AlertDispatcher"
Run carthage update
to build the framework and drag the built AlertDispatcher.framework
into your Xcode project.
The Swift Package Manager is a tool for automating the distribution of Swift code and is integrated into the swift
compiler. It is in early development, but AlertDispatcher
does support its use on supported platforms.
Once you have your Swift package set up, adding TaskKit as a dependency is as easy as adding it to the dependencies
value of your Package.swift
.
dependencies: [
.Package(url: "https://github.com/OlegKetrar/AlertDispatcher")
]
AlertDispatcher
is released under the MIT license. See LICENSE
for details.