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)
UIAlertController在Swift中的用法
最新推荐文章于 2024-08-23 21:40:40 发布