gpt4 book ai didi

ios - 如何在设置 swift 3.0 时从我自己的应用程序重定向到“设置常规”选项卡

转载 作者:可可西里 更新时间:2023-11-01 05:32:53 26 4
gpt4 key购买 nike

您好,我无法从我的应用程序重定向到设置中的“常规”选项卡。这是我的代码,请帮助

我在 url 模式中添加了 prfes

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
})

}

最佳答案

在 iOS 10 中,他们将“prefs:”更改为“App-Prefs:”

        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)")

})
}

关于ios - 如何在设置 swift 3.0 时从我自己的应用程序重定向到“设置常规”选项卡,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42131979/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com