码迷,mamicode.com
首页 > 其他好文 > 详细

让UIAlertController同时兼容iphone和ipad

时间:2014-10-16 19:22:02      阅读:332      评论:0      收藏:0      [点我收藏+]

标签:ios

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


让UIAlertController同时兼容iphone和ipad

标签:ios

原文地址:http://blog.csdn.net/rainlesvio/article/details/40150975

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!