Swift 基本控件UIAlertView学习

来源:互联网 发布:python网络爬虫是什么 编辑:程序博客网 时间:2024/05/22 00:40
 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("点击了确认")        }    }

0 0
原创粉丝点击