iOS10跳转设置

由于苹果在iOS10中禁用了跳转设置界面(仅允许跳转app自身的设置界面),如果想跳转其他设置层级,比如关于本机,可以通过私有API来跳:

//注意首字母改成了大写,prefs->Prefs
    NSURL*url=[NSURL URLWithString:@"Prefs:root=General&path=About"];
    Class LSApplicationWorkspace = NSClassFromString(@"LSApplicationWorkspace");
    [[LSApplicationWorkspace performSelector:@selector(defaultWorkspace)] performSelector:@selector(openSensitiveURL:withOptions:) withObject:url withObject:nil];

————————
完结撒花

你可能感兴趣的:(iOS10跳转设置)