测试已测试 | ✗ |
语言语言 | SwiftSwift |
许可 | MIT |
发布最新发布 | 2017年10月 |
SwiftSwift 版本 | 4.0 |
SPM支持 SPM | ✗ |
由 Hasan Ali Asan 维护。
这个工具是一个为 iOS 定制的动态操作表,使用 Swift 3.0 编写。
import UIKit
import HAActionSheet
class ViewController: UIViewController {
let data = ["Apple",
"Orange",
"Banana",
"Berry"]
override func viewDidLoad() {
super.viewDidLoad()
let view = HAActionSheet(fromView: self.view, sourceData: data)
view.buttonCornerRadius = 16
view.show { (canceled, index) in
if !canceled {
print(self.data[index!])
}
}
}
}
/// title for cancel button, default is "Cancel"
public var cancelButtonTitle: String
/// corner radius for cancel button, first and last button, default is 16.0
public var buttonCornerRadius: CGFloat
/// font for header title, default is UIFont.boldSystemFont(ofSize: 17)
public var headerTitleFont: UIFont
/// font for header message, default is UIFont.systemFont(ofSize: 14)
public var headerMessageFont: UIFont
/// header background color, default is white
public var headerBackgroundColor: UIColor
/// header text color, default is black
public var headerTextColor: UIColor
/// font for button titles, default is system font
public var titleFont: UIFont
/// cancel button title color, default is red
public var cancelButtonTitleColor: UIColor
/// cancel button background color, default is white
public var cancelButtonBackgroundColor: UIColor
/// button title color, default is blue
public var buttonTitleColor: UIColor
/// button background color, default is white
public var buttonBackgroundColor:UIColor
/// button seperator color, default is #EDEDEF
public var seperatorColor: UIColor