让UIAlertController兼容的同时iphone和ipad
by 吴雪莹
var alert = UIAlertController(title: nil, message: message, preferredStyle: UIAlertControllerStyle.ActionSheet) alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler: { (alert:UIAlertAction!) -> Void in println("You tapped OK") })) alert.popoverPresentationController?.sourceView = view alert.popoverPresentationController?.sourceRect = sender.frame self.presentViewController(alert, animated: true, completion: nil)
版权声明:本文博客原创文章。博客,未经同意,不得转载。