Skip to content

Latest commit

 

History

History
44 lines (35 loc) · 1.49 KB

Readme.md

File metadata and controls

44 lines (35 loc) · 1.49 KB

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