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

UIAlertController在Swift中的用法

2016-07-03 00:02 483 查看
let alert:UIAlertController = UIAlertController(title: "message" ,message: "Thank you clicking",preferredStyle: UIAlertControllerStyle.Alert)
alert.addAction(UIAlertAction(title: "close AlertView",style: UIAlertActionStyle.Default,handler: nil))
alert.addAction(UIAlertAction(title: "change color",style: UIAlertActionStyle.Default,handler:{alertAction in
UIView.animateWithDuration(2.5, animations: {self.headerView.backgroundColor = UIColor.brownColor()}, completion: {_ in
print("animate close")
})
}))
self.presentViewController(alert,animated:true,completion:nil)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息