Nach der Installation Pod mit pod SCLAlertView
Sie Alert view Style
und Alert View Animation
Art mit diesen Aufzählungen können wählen
enum SCLAlertViewStyle: Int {
case Success, Error, Notice, Warning, Info, Edit, Wait
}
public enum SCLAnimationStyle {
case NoAnimation, TopToBottom, BottomToTop, LeftToRight, RightToLeft
}
SCLAlertView hat viele Kontrollgruppen hinzufügen, Textfield, Schaltflächen und Symbole
hier ist ein Hinzufügen von Tastenfunktionscodes
let alertView = SCLAlertView()
alertView.addButton("First Button", target:self, selector:Selector("firstButton"))
alertView.addButton("Second Button") {
println("Second button tapped")
}
alertView.showSuccess("Button View", subTitle: "This alert view has buttons")
und Alert-Ansicht benutzerdefinierte Typen
SCLAlertView().showError("Hello Error", subTitle: "This is a more descriptive error text.") // Error
SCLAlertView().showNotice("Hello Notice", subTitle: "This is a more descriptive notice text.") // Notice
SCLAlertView().showWarning("Hello Warning", subTitle: "This is a more descriptive warning text.") // Warning
SCLAlertView().showInfo("Hello Info", subTitle: "This is a more descriptive info text.") // Info
SCLAlertView().showEdit("Hello Edit", subTitle: "This is a more descriptive info text.") // Edit
in Github Seite Sie viele schöne Desing Alarm Ansichten finden, ist es leicht,
https://github.com/vikmeup/SCLAlertView-Swift
Was ist Gewohnheit über Ihre Warnung vor zu benutzen? Warum können Sie keinen normalen 'UIAlertController' verwenden? ('UIAlertView' ist veraltet). – rmaddy