让UIAlertController兼容的同时iphone和ipad

让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)



版权声明:本文博客原创文章。博客,未经同意,不得转载。

posted @ 2015-06-30 15:09  mfrbuaa  阅读(418)  评论(0)    收藏  举报