A simple alert box designed for iOS, with simple API.
Library is developed and tested with XCode 8+ and Swift 3.0
pod 'EYSnapAlert'
Drag 'EYSnapAlert.swift' to your project
Show a alert with a single line
// Show alert with default settings
EYSnapAlert.show(message: "世界,你好")
// Show alert with fully customized setttings
EYSnapAlert.show(message: String(format: "你好,世界, [Style: %@]", cell.textLabel!.text!),
backgroundColor: UIColor.black,
textSize: 12,
textColor: UIColor.white,
duration: 3,
animationTime: 0.2,
cornerRadius: 5,
style: .popUp,
onTap: { (alert) in
alert.hide()
print("Alert is tap...")
},
onDimissed: {() in
print("Alert was dismissed")
})
For more detail, please refer to the Example project.