简体   繁体   中英

iOS Settings Bundle - How should text inputs be validated?

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM