PKCAlertView 0.1.6

PKCAlertView 0.1.6

测试已测试
语言语言 SwiftSwift
许可 MIT
发布最后发布2017年11月
SwiftSwift版本3.0
SPM支持SPM

pikachu987 维护。



  • pikachu987

PKCAlertView

示例

image image image image image

要运行示例项目,请克隆仓库,并首先从 Example 目录运行 pod install




import PKCAlertView

let alertView = PKCAlertView("Title", message: "Message", bgColor: UIColor(red: 170/255, green: 170/255, blue: 170/255, alpha: 0.8))
self.view.pkc_addSubview(alertView)

alertView.addAlertButton("Default") { (type, text) in

}

alertView.addAlertView("OK") { (type, text) in
    
}

alertView.addAlertView("Cancel", rightText: "OK") { (type, text) in

}

alertView.addAlertView("Left", centerText: "Center", rightText: "Right", handler: { (type, text) in
                   
})



let pkcAlertButton = PKCAlertButton("CustomButton")
pkcAlertButton.addTarget(self, action: #selector(self.defaultAction(_:)), for: .touchUpInside)
pkcAlertButton.titleLabel?.font = UIFont.boldSystemFont(ofSize: 19)
pkcAlertButton.backgroundColor = UIColor(red: 240/255, green: 240/255, blue: 240/255, alpha: 1)
pkcAlertButton.highlightColor = UIColor(red: 210/255, green: 210/255, blue: 210/255, alpha: 1)


alertView.addAlertButton(pkcAlertButton, handler: { (type, text) in

})


let pkcAlertButton1 = PKCAlertButton("CustomLeftButton")
let pkcAlertButton2 = PKCAlertButton("CustomRightButton")
alertView.addAlertButton(pkcAlertButton1, rightButton: pkcAlertButton2, handler: { (type, text) in

})



let pkcAlertButton3 = PKCAlertButton("CustomLeftButton")
let pkcAlertButton4 = PKCAlertButton("CustomCenterButton")
let pkcAlertButton5 = PKCAlertButton("CustomRightButton")
alertView.addAlertButton(pkcAlertButton3, centerButton: pkcAlertButton4, rightButton: pkcAlertButton5, handler: { (type, text) in

})





alertView.animationType = .default
alertView.animationType = .alpha
alertView.animationType = .modal
alertView.animationTime = TimeInterval(0.5)

alertView.show()

安装

PKCAlertView 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中:

pod "PKCAlertView"

作者

pikachu987, [email protected]

许可

PKCAlertView 可在 MIT 许可下使用。更多信息请参阅 LICENSE 文件。