标签:ios
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)让UIAlertController同时兼容iphone和ipad
标签:ios
原文地址:http://blog.csdn.net/rainlesvio/article/details/40150975