TBD
To integrate Alert Controller into your Xcode project using Carthage, specify it in your Cartfile
:
github "sebastianvarela/iOS-Alert-Controller"
In any UIViewController, add the imports:
import AlertController
import ReactiveSwift
And call the method when we want to present the alert:
func someMethod() {
presentAlert(title: "Title", subtitle: "Subtitle", buttonTitle: "primary", secondaryButtonTitle: "secondary", showClose: true, iconType: .info)
.observe(on: UIScheduler())
.startWithValues { event in
switch event.userAction {
case .primaryButtonTapped: primaryAction()
case .dismissButtonTapped: fallthrough
case .secondaryButtonTapped: secondaryAction()
}
event.dismissAlert(animated: true)
}
}