UIAlertControllerで設定画面を開く
UIAlertControllerでアプリの設定画面を開きます。
こうすることで、ユーザーの手間を少しは省けます。
欲を言うと、「Facebookアプリの設定画面」や「設定アプリのトップ」へ移動させるURLSchemeが欲しかった。
let alertController = UIAlertController( title: "title", message: "message", preferredStyle: UIAlertControllerStyle.Alert ) alertController.addAction(UIAlertAction(title: NSLocalizedString("キャンセル", comment: "キャンセル"), style: .Cancel, handler: nil)) alertController.addAction(UIAlertAction(title: NSLocalizedString("設定画面へ", comment: ""), style: .Default, handler: { (action:UIAlertAction) -> Void in // 設定画面を開く if let url = NSURL(string:UIApplicationOpenSettingsURLString) { UIApplication.sharedApplication().openURL(url) } })) self.presentViewController(alertController, animated: true, completion: nil)