2017-02-09 5 views
1

こんにちは、私のアプリから設定の[一般]タブにリダイレクトできません。 「App-環境設定:スウィフト3.0の設定で、自分のアプリから設定の全般タブにリダイレクトする方法

if let url = URL(string:UIApplicationOpenSettingsURLString) { 
       print(url) 
      } 
+0

UIApplication.shared.open(URL(STRI ng: "prefs:root = General&path = ManagedConfigurationList")!) 私はこれを試してみましたが、使用しません。 –

答えて

2

はiOSの10で、彼らは "環境設定" に変更:ここに私のコードは、この

に助けてください、私は

guard let settingsUrl = URL(string:"prefs:root=General") else { 
     return 
    } 

    if UIApplication.shared.canOpenURL(settingsUrl) { 

     UIApplication.shared.open(settingsUrl, completionHandler: { (success) in 
      print("Settings opened: \(success)") // Prints true 
     }) 

    } 
0

利用コード以下のURLスキーマでprfesを追加しました: 「

 guard let profileUrl = URL(string: "App-  
     Prefs:root=General") else { 
      return 
     } 

     if UIApplication.shared.canOpenURL(profileUrl) { 

     UIApplication.shared.open(profileUrl, completionHandler: { (success) in 

      print(" Profile Settings opened: \(success)") 

      }) 
     } 
+0

こんにちはHiren、あなたの返事をありがとう。私はアプリの設定に移動することができますが、私はそれが設定の一般タブに直接ナビゲートしたい。あなたの答えはアプリの設定にリダイレクトすることができます –

+0

UIApplication.shared.open(URL(文字列: "prefs:root = General&path = ManagedConfigurationList")!) 私はこれを試してみましたが使用しません –

+0

これはハーフアップかもしれません:UIApplication.sharedApplication .openURL(NSURL(文字列: "prefs:root = General")!) – Hiren

関連する問題