简体   繁体   中英

Existing iOS form framework

Hello I am building forms over and over in iPhone and iPad apps:

  • Custom UITableViewCells for labels with input
  • Localization for labels, placeholder text and section headers
  • Validation that marks the cells red or something and does not allow "Submit" if form is incomplete
  • Clicking in the cell activates the editable text box
  • Next / previous buttons
  • Reliable across devices, orientations, iOS versions

I can't imagine I'm the only one doing this. Is there a mature framework or something that can drop in and use? Could you please comment on how you use this library with designs other than vanilla UITableViews with your own colors etc.?

Take a look at IBAForms - an open source project from from Itty Bitty Apps. I haven't used it yet myself, however I believe it does most of what you want, except for validation. Here is the github page: IBA Forms

It hasn't been maintained in a while, but if you're looking for a forms library - it's mature and works. At the very least, it could be the starting point for something you take further.

  • Update: There is also Chris Miles' EZForm library, which is very nice.

  • Update #2: Have also started checking out QuickDialog , which seems to be very popular.

  • Update #3: Nick Lockwood has created one called FXForms

  • Update #4: Martin Barreto has created one called XLForm

I don't know if this counts as an answer, but i use Sensible Cocoa - Sensible TableView (STV) for this purpose a lot. It's not a "forms" framework (on top of UITableView) as such, but it can be used for this purpose in a very flexible way. It still requires some coding to build a full-fledged form but the UITableView/UITableViewController boilerplate code is reduced to a minimum. Unfortunately the developers bumped the price tag quite high with version 3.0, so i'm actually looking for a STV replacement right now. (I'd stick with STV if it wasn't for the price!)

I don't know of anything that combines all those features, but I recently open-sourced my validation library PMValidation on github, which I used developing the iPhone app Imprints . PMValidation comes with many basic types suitable for validating forms, and in fact that's what I originally built it for.

Using the PMValidationManager class you can easily listen to UITextViews or UITextFields, and update whatever graphical widgets you want via notifications. It's very modular and easily extendable, should you have more unique needs. It's under the MIT license.

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