Skip to content

berenjena-power/iOS-Alert-Controller

Repository files navigation

iOS-Alert-Controller

Platform iOS Swift 3 compatible Carthage compatible License: MIT

Introduction

Configuration

TBD

Usage

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published