UIAlertController在Swift中的用法

來源:互聯網
上載者:User
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)

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.