ios - 在 iOS 11 中从我的应用程序打开设置应用程序中的特定项目

标签 ios swift ios11

我研究了几个答案,但没有找到适用于 iOS 11 的答案。

我想展示为我的用户打开后台应用刷新的方法。要做到这一点 我想从我的应用程序中打开 Settings/General/Background App Refresh 菜单。 以下代码仅打开“设置”应用的根菜单。

guard let url = URL(string: "App-Prefs:root=General&path=BACKGROUND_APP_REFRESH") else { return }

UIApplication.shared.open(url, options: [:], completionHandler: nil)

Apple 是否允许这样做?

最佳答案

如果打开网址UIApplicationOpenSettingsURLString然后您将获得应用的设置,其中包括后台应用刷新。

关于ios - 在 iOS 11 中从我的应用程序打开设置应用程序中的特定项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48771321/

相关文章:

swift - 将 ViewController 分配给类,反之亦然

swift - CoreMIDI 目标的困惑

ios - 使用 UIPercentDrivenInteractiveTransition 更改 animateTransition 中的动画值

ios - 我应该为 Pod 使用 Swift 4 迁移工具吗?

ios - UIViewPropertyAnimator 在 iOS10 和 iOS11 上反转动画的不同行为。 `isReversed` 和 `fractionComplete` 属性上的错误?

javascript - ios iframe 仅在方向从纵向更改后不可滚动 ->横向

ios - Xcode 中的 Storyboard 引用,我们应该在哪里使用它?

ios - swift:完成处理程序

ios - 是否可以自定义 iPhone 本地通知的显示?

ios - UITableViewCell contentView inset on iPhone X