Da

🌟 Naughty flexible alert view. Like QQ's. Support: https://LeoDev.me


Keywords
alertview, cocoapods, flexible, naughty, swift
License
MIT
Install
pod try Da

Documentation

Da

Travis CocoaPods CocoaPods CocoaPods LeoDev

🌟 Naughty flexible alert view above the navigation bar, like QQ's. Da is a part of DaXia.

In me the tiger sniffs the rose.

心有猛虎,细嗅蔷薇。

Welcome to visit my blog:https://LeoDev.me

Contents

Requirements

  • iOS 8.0+
  • Xcode 8.0+
  • Swift 3.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

CocoaPods 1.1.0+ is required to build Da.

To integrate Da into your Xcode project using CocoaPods, specify it in your Podfile:

use_frameworks!

target '<Your Target Name>' do
    pod 'Da'
end

Manually

If you prefer not to use the aforementioned dependency manager, you can integrate Da into your project manually.

Usage

  • Quick Start:

    import Da
    
    func showAlertQuickly() {
    
        Da.showAlert(title: "温馨提示",
                     message: "您的账号已在其他设备登录,请您注意账号安全。",
                     cancelButtonTitle: "退出",
                     otherButtonTitles: nil)
    }
  • Detailed:

    func showAlertDetailedly() {
    
        Da.hairColor = UIColor.orange
        let da = Da(title: "温馨提示",
                    message: "您的账号已在其他设备登录,请您注意账号安全。",
                    cancelButtonTitle: "退出",
                    otherButtonTitles: "重新登录", "修改密码")
        da.destructiveButtonIndexSet = Set(arrayLiteral: 0)
        da.destructiveButtonColor = UIColor.orange
        da.clickedHandle = { da, buttonIndex in
            print("clickedHandle: \(buttonIndex), \(da.cancelButtonIndex)")
        }
        da.willPresentHanlder = { da in
            print("willPresentHanlder, \(da.cancelButtonIndex)")
        }
        da.didPresentHanlder = { da in
            print("didPresentHanlder, \(da.cancelButtonIndex)")
        }
        da.willDismissHandler = { da, buttonIndex in
            print("willDismissHandler: \(buttonIndex), \(da.cancelButtonIndex)")
        }
        da.didDismissHandler = { da, buttonIndex in
            print("didDismissHandler: \(buttonIndex), \(da.cancelButtonIndex)")
        }
        da.show()
    }
    
    // And more see Da.swift...
  • Resources:

Preview

ChangeLog

V 0.0.2

  • Improve.

V 0.0.1

  • Hello World!

Support

License

Da is released under the MIT License.