Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 1.48 KB

README.md

File metadata and controls

59 lines (42 loc) · 1.48 KB

EasyAlertController

UIAlertCotroller extensions for easy using

Requirements

  • iOS 8.0+
  • Xcode 7.3

Installation

Just add the EasyAlertController.swift to your project.

or use CocoaPods with Podfile:

pod 'EasyAlertController'

or Carthage users can simply add to their Cartfile:

github "ober01/EasyAlertController"

Usage

boring:

let actionSheet = UIAlertController(title: "title", message: "message", preferredStyle: .ActionSheet)

let action = UIAlertAction(title: "default", style: .Default, handler: {_ in print("tap")})
let cancel = UIAlertAction(title: "cancel", style: .Cancel, handler: {_ in print("tap")})
let destructive = UIAlertAction(title: "action", style: .Destructive, handler: {_ in print("tap")})

actionSheet.addAction(action)
actionSheet.addAction(cancel)
actionSheet.addAction(destructive)

presentViewController(alert, animated:true, completion:nil)

cool:

let actionSheet = UIAlertController.actionSheet(actions: [
  .Default(title: "Default", handler: { _ in print("tap")}),
  .Destructive(title: "Destructive", handler: { _ in print("tap")}),
  .Cancel(title: "Cancel", handler: nil)
  ])
  
  presentViewController(alert, animated:true, completion:nil)

Licence

​ EasyAlertController is released under the MIT license. See LICENSE for details. ​

About

Any questions write [email protected] follow @KalinkinAleksey