BEEPopupKit 1.0.4

BEEPopupKit 1.0.4

Maintained by liuxc.



  • By
  • liuxc123

BEEPopupKit

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

BEEPopupKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'BEEPopupKit'

Usage

Quick Usage

// Customized view
let customView = SomeCustomView()
/*
Do some customization on customView
*/

// Attributes struct that describes the display, style, user interaction and animations of customView.
var attributes = BEEAttributes()
/*
Adjust preferable attributes
*/

And then, just call:

BEEPopupKit.display(entry: customView, using: attributes)

Alert

let alert = BEEAlertView(title: "我是主标题", message: "我是副标题", imageName: "info")
let action1 = BEEAlertAction(title: "确定", style: .default) { (action) in
    print("点击了确定")
}
let action2 = BEEAlertAction(title: "取消", style: .destructive) { (action) in
    print("点击了取消")
}
action2.titleColor = BEEColor(.red)
alert.addAction(action1)
alert.addAction(action2)
alert.show()

ActionSheet

let actionSheet = BEEActionSheetView(title: "我是主标题", message: "我是副标题", imageName: "zhiwen")

let action1 = BEEAlertAction(title: "Default", style: .default) { (action) in
    print("点击了Default")
}

let action2 = BEEAlertAction(title: "Destructive", style: .destructive) { (action) in
    print("点击了Default")
}

let action3 = BEEAlertAction(title: "Cancel", style: .cancel) { (action) in
    print("点击了Default")
}

actionSheet.addAction(action1)
actionSheet.addAction(action3) // 取消按钮一定排在最底部
actionSheet.addAction(action2)
actionSheet.show()

Author

liuxc123, [email protected]

License

BEEPopupKit is available under the MIT license. See the LICENSE file for more info.