Adding a button to an iPhone prefs / settings bund

2019-02-23 23:37发布

Just wondering if it's possible to add a button like the "Clear History", "Clear Cookies" etc buttons in the Safari preferences to your own app's settings bundle? Been digging through the dev docs and can't find any plist specifier for a button, so I'm wondering if this is an internal API for the Apple guys?

After you hit the button, you get an action sheet asking you whether you really want to do it, and then presumably there is some callback based on the user's input.

Also noticed that the Nike + iPod settings have a clear button in them, but again, that app might have access to internal APIs that we don't.

alt text

3条回答
放荡不羁爱自由
2楼-- · 2019-02-23 23:48

No, this is not possible. The system only supports interacting with the values from within your app. You can't run code from the settings app so a button would be useless.

查看更多
SAY GOODBYE
3楼-- · 2019-02-24 00:01

iOSOpenDev, which extends Xcode for iOS jailbreak-style project development, provides project templates that have a check boxes to include either a simple PreferenceLoader (plist-based) or a full PreferenceLoader bundle.

查看更多
我想做一个坏孩纸
4楼-- · 2019-02-24 00:12

Nike+iPod is a root application. Anything running under root can run code from basically anywhere (with restrictions, Sandbox is a b**ch) If you're interested you can make a jailbreak preferencebundle with Theos or iOSOpenDev! Which allows you to make a root bundle that can run button action code.

查看更多
登录 后发表回答