您的位置:首页 > 移动开发 > Swift

Swift 基本控件UIAlertView学习

2016-02-23 10:46 483 查看
let alertView = UIAlertView()
alertView.title = "系统提示"
alertView.message = "您确定要离开hangge.com吗?"
alertView.addButtonWithTitle("取消")
alertView.addButtonWithTitle("确定")
alertView.cancelButtonIndex=0
alertView.delegate=self;
alertView.show()

func alertView(alertView:UIAlertView, clickedButtonAtIndex buttonIndex: Int){
if(buttonIndex==alertView.cancelButtonIndex){
print("点击了取消")
}
else
{
print("点击了确认")
}
}


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: