Customized-Popup
自定义弹出窗:带有自定义视图的弹出窗之一。您可以在弹出窗中显示地图、图片和文本。易于维护:P
先决条件
Xcode 9和Swift 4
入门
一组有用的警报弹出窗
let alertController = CustomizedPopup()
- 显示带有地图的警报
alertController.alertWithMapView(latitude: 37.57554038, longitude: -122.40068475)
这将显示一个警报视图,其中包含提供的地图视图,并带有经纬度。
- 显示带有文本和图像的警报
alertController.alertWithImage(image: #imageLiteral(resourceName: "default"), message: "Hey Check this is awesome na ????",showCancelButton: true)
这将显示一个警报视图,其中包含在自定义视图中提供的文本和图像。
- 显示仅包含文本和消息的警报
alertController.simpleAlert(title: "Hello Alert", message: "Alert or Not ??", showCancelButton: false)
这将显示一个简单的文本和消息在警报视图中。
除了这些,您还可以使用代理CustomizedPopupDelegate
在您的自定义视图控制器或模型/视图文件中处理动作
func customizedOkButtonTapped(obj: UIButton) {
print("ok button called hello")
}
自定义
alertController.delegate = self
alertController.height = 200.0
alertController.alertTextColor = UIColor.darkGray
alertController.cancelButtonBackGroundColor = UIColor.red
alertController.cancelButtonTextColor = UIColor.white
alertController.cornerRadius = 20.0
alertController.okButtonTextColor = UIColor.white
alertController.backGroundColor = UIColor.lightGray
alertController.okButtonBackGroundColor = UIColor.darkGray
alertController.alertWithImage(image: #imageLiteral(resourceName: "default"), message: "Hey Check this is awesome na ???? Something looks too cool bro. Ohh this is popup", showCancelButton: true)
广泛的定制范围,使您的应用根据您的需求看起来和感觉都很好。
作者
欢迎提出建议和反馈:Facebook,Github,Twitter,LinkedIn
许可协议
此项目遵循MIT许可协议 - 有关详细信息,请参阅LICENSE.md文件