方法presentViewController在更新后不能在iOS 8.3上工作
我刚刚更新了Xcode到版本6.3(与iOS SDK 8.3),我的项目 – 完美地工作在8.1和8.2 – 似乎有问题与presentViewController
方法。
码:
var alert = UIAlertController(title: "\(Percent)%", message: TipsMessage, preferredStyle: UIAlertControllerStyle.Alert) alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.Default, handler:nil)) self.presentViewController(alert, animated: true, completion: nil)
任何人都可以帮我吗?
添加这个alertController是超类….
lazy var alertController: UIAlertController = { [weak self] in let alert = UIAlertController(title: "Alert", message: "This is a demo alert", preferredStyle: .Alert) alert.addAction(UIAlertAction(title: "OK", style: .Default, handler: nil)) return alert }() override func viewDidAppear(animated: Bool) { super.viewDidAppear(animated) self.presentViewController(alertController, animated: true, completion: nil) }