0

I need a data reset switch my application, I'd like to put it in Settings->Apps->MyAppName section of iOS. Being a destructive action I want iOS to prompt the user for confirmation. Is there a way to display an alertview style confirmation box from within app settings?

Placing the switch and alertview within the app is no problem to me, I just can't figure out how to display an alert from the settings page. Google searches haven't yielded anything so far.

Thanks

Scaroth
  • 187
  • 1
  • 11
  • There is no API for the settings.bundle, therefor you can not interact with the user. So there is no way to present or let iOS present a dialog. – rckoenes Oct 13 '14 at 12:59
  • Dang, what a shame. My only work around then might be...to set the switch outside the app, then the app could prompt the user on startup/ or applicationWillEnterForeground. – Scaroth Oct 13 '14 at 13:27

2 Answers2

2

Putting the "delete all data" switch on the settings page of your application wouldn't do anything to the data stored by your app. Only a property within the NSUserDefaults would become YES. Since it is up to your app to delete all data the next time it becomes active (checking the NSUserDefaults), you can display an UIAlertView from your app that gets a confirmation from the user.

It is not possible to integrate such a logic right in the settings app.

Christian
  • 357
  • 3
  • 13
1

Simple NO is the answer here. You have no possibility to access what happens in the Settings App of the iOS device that uses your app. You can only configure what should be configured, no logic can be added.

nburk
  • 22,409
  • 18
  • 87
  • 132