使用在IOS 9 alertview与迅速
问题描述:
当与迅速,编译器IOS 9 I用户alertview示出了该警告消息:使用在IOS 9 alertview与迅速
UIAlertView中”在IOS 9.0被弃用:UIAlertView中已被弃用。使用UIAlertController与UIAlertControllerStyleAlert的preferredStyle代替
答
尝试使用此代码
let alert = UIAlertController(title: "TITLE", message: "MESSAGE", preferredStyle: UIAlertControllerStyle.Alert)
let okAction = UIAlertAction(title:"OK", style: UIAlertActionStyle.Cancel, handler: { (action) -> Void in
})
alert.addAction(okAction)
dispatch_async(dispatch_get_main_queue(),{
self.presentViewController(alert, animated: true, completion: nil)
})
是的,像有消息称,它已过时。检查这个喜欢的文档:可能解决你的问题http://*.com/documentation/ios/874/uialertcontroller#t=201607261258026665057 – Idan
你的问题是什么? – fantaghirocco
[UIAlertView首次弃用IOS 9]的可能重复(http://*.com/questions/32690086/uialertview-first-deprecated-ios-9) –