Latest 1.5.1
Homepage https://github.com/ChaselAn/FancyAlert
License MIT
Platforms ios 9.0, requires ARC
Authors

FancyAlert

  • A more fancy alert
  • You can use it like UIAlert

Requirements

  • Swift 4.0, iOS 9.0

Installation

  • With Cocoapods:
  • swift4.0:
pod 'FancyAlert', '~> 1.4.2'
# Then, run the following command:
$ pod install
  • swift4.2:
pod 'FancyAlert', '~> 1.5.1'
# Then, run the following command:
$ pod install

Example

  • Normal Alert

FancyAlert

  • Alert with TextField

FancyAlert

  • Alert with more TextFields

FancyAlert

  • Alert with TextView

FancyAlert

  • Alert with Progress

FancyAlert

  • ActionSheet

FancyAlert

How to use

let firstAction = FancyAlertAction(title: "第一个", style: .normal, handler: {
            print("第一个action")
        })
let alertViewController = FancyAlertViewController(style: .alert, title: "大标题大标题大标题大标题大标题大标题大标题大标题大标题", message: "小标题小标题小标题小标题小标题小标题小标题小标题小标题小标题小标题小标题小标题小标题小标题", actions: [firstAction])
let cancelAction = FancyAlertAction(title: "取消", style: .cancel, handler: {
            print("取消action")
        })
alertViewController.addAction(cancelAction)
alertVC.addTextField { (textField) in
                textField.placeholder = "请输入用户名"
                textField.style = .gray
                textField.maxInputLength = 10
            } // add textField
alertVC.addTextView { (textView) in
                textView.maxInputLength = 50
            } // add textView
alertViewController.hasProgress = true // have progress
alertViewController.progress = 0.5 // progress value
present(alertViewController, animated: true, completion: nil)
  • Global properties can be set by FancyAlertConfig

Latest podspec

{
    "name": "FancyAlert",
    "version": "1.5.1",
    "summary": "fancy alert",
    "homepage": "https://github.com/ChaselAn/FancyAlert",
    "license": "MIT",
    "authors": {
        "ChaselAn": "[email protected]"
    },
    "platforms": {
        "ios": "9.0"
    },
    "source": {
        "git": "https://github.com/ChaselAn/FancyAlert.git",
        "tag": "1.5.1"
    },
    "source_files": "FancyAlert/*.swift",
    "requires_arc": true,
    "resources": "FancyAlertDemo/*.xcassets"
}

Pin It on Pinterest

Share This