1
votes

I'm creating a settings bundle for my app to allow users to set their default application server. How should I be validating the user input for a Text Field in the settings?

I've found this post from 6 years ago, and also have read through the apple docs and realize there is no mention of input validation.

1

1 Answers

1
votes

There is no way to do input validation for stuff in settings.bundle while the user is typing. You'll need to do this when your app starts, and/or in response to the UserDefaults.didChangeNotification notification, and there's no really good way to provide user feedback.

That said, there are 3rd party libraries out there that allow you to move this stuff from the system's settings app into your app directly, making it much more easy to access, and also allow a high degree of customisation, in particular https://github.com/futuretap/InAppSettingsKit.