원할 때마다 다른 UIAlertAction을 UIAlertController에 추가하기 만하면됩니다.
let alertAction: UIAlertAction = UIAlertAction(title: "YES", style: UIAlertActionStyle.Default, handler: {
//Code goes here
})
let alertAction2: UIAlertAction = UIAlertAction(title: "NO", style: UIAlertActionStyle.Default, handler: {
//Code goes here
})
let alertAction3: UIAlertAction = UIAlertAction(title: "Maybe", style: UIAlertActionStyle.Default, handler: {
//Code goes here
})
alert.addAction(alertAction)
alert.addAction(alertAction2)
alert.addAction(alertAction3)
필요에 따라 UIAlertAction을 UIAlertController에 동적으로 추가 할 수 있습니다. 두 개의 버튼 만 필요한 경우 alertAction3
을 추가하지 마십시오. 3 ~ 4 명이 필요한 경우 필요에 따라 추가하십시오. 당신이 열거
enum SCLAlertViewStyle: Int {
case Success, Error, Notice, Warning, Info, Edit, Wait
}
public enum SCLAnimationStyle {
case NoAnimation, TopToBottom, BottomToTop, LeftToRight, RightToLeft
}
SCLAlertView와 Alert view Style
및 Alert View Animation
스타일을 선택할 수 있습니다 pod SCLAlertView
로 설치 포드 후
당신의 경고에 대한 사용자 정의 기능을 쉽게 사용할 수 있나요? 왜 당신은 정상적인'UIAlertController'를 사용할 수 없습니까? ('UIAlertView'는 더 이상 사용되지 않습니다). – rmaddy