0
シンプルなアラートを作成していますが、このエラーが表示されています。UIAlertControllerが最新のXcodeでエラーを表示しています
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
@IBAction func but (action:UIButton) {
let alertcontroller = UIAlertController(title: "Title", message: "message", preferredStyle: .Alert)
let alert = UIAlertAction(title: "Action titel", style: .Default, handler: nil)
alertcontroller.addAction(alert)
self.presentedViewController (alertcontroller, animated:true, completion: nil)
}
}
と私のためにどのような作品であり、 'self.presentViewController'の代わりに.presentedViewController'を実行します。 – dan