[Swift Tip] 打开App的设置页面

用于打开系统设置页面

guard let url = URL(string:"App-Prefs:root=General"), UIApplication.shared.canOpenURL(url) else {
            return
        }
        
UIApplication.shared.open(url, options: [:], completionHandler: nil)

用于打开系统设置中某个APP的设置页面

guard let url = URL(string: UIApplication.openSettingsURLString), UIApplication.shared.canOpenURL(url) else {
            return
        }

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

你可能感兴趣的:([Swift Tip] 打开App的设置页面)