简体   繁体   English

现有的iOS表单框架

[英]Existing iOS form framework

Hello I am building forms over and over in iPhone and iPad apps: 您好我正在iPhone和iPad应用程序中反复构建表单:

  • Custom UITableViewCells for labels with input 自定义UITableViewCells用于带输入的标签
  • 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 跨设备,方向,iOS版本可靠

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.? 你可以评论你如何使用这个库与除了香草UITableViews之外的设计与你自己的颜色等?

Take a look at IBAForms - an open source project from from Itty Bitty Apps. 看一下来自Itty Bitty Apps的开源项目IBAForms。 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 这是github页面: 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. 更新:还有Chris Miles的EZForm库,非常好。

  • Update #2: Have also started checking out QuickDialog , which seems to be very popular. 更新#2:还开始查看QuickDialog ,这似乎非常受欢迎。

  • Update #3: Nick Lockwood has created one called FXForms 更新#3:Nick Lockwood创建了一个名为FXForms的产品

  • Update #4: Martin Barreto has created one called XLForm 更新#4:Martin Barreto创建了一个名为XLForm的程序

I don't know if this counts as an answer, but i use Sensible Cocoa - Sensible TableView (STV) for this purpose a lot. 我不知道这是否算作答案,但我为此目的使用了Sensible Cocoa - Sensible TableView(STV) 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. 它不是“表单”框架(在UITableView之上),但它可以非常灵活的方式用于此目的。 It still requires some coding to build a full-fledged form but the UITableView/UITableViewController boilerplate code is reduced to a minimum. 它仍然需要一些编码来构建一个完整的表单,但UITableView / UITableViewController样板代码减少到最低限度。 Unfortunately the developers bumped the price tag quite high with version 3.0, so i'm actually looking for a STV replacement right now. 不幸的是,开发人员在3.0版本上将价格标签提高了很多,所以我现在正在寻找STV的替代品。 (I'd stick with STV if it wasn't for the price!) (如果价格不合适,我会坚持使用STV!)

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 . 我不知道任何结合所有这些功能的东西,但我最近在github上开源了我的验证库PMValidation ,我用它来开发iPhone应用程序Imprints PMValidation comes with many basic types suitable for validating forms, and in fact that's what I originally built it for. PMValidation附带了许多适用于验证表单的基本类型,事实上这就是我最初为它构建的。

Using the PMValidationManager class you can easily listen to UITextViews or UITextFields, and update whatever graphical widgets you want via notifications. 使用PMValidationManager类,您可以轻松地收听UITextViews或UITextFields,并通过通知更新您想要的任何图形小部件。 It's very modular and easily extendable, should you have more unique needs. 如果您有更多独特需求,它非常模块化且易于扩展。 It's under the MIT license. 它是在麻省理工学院的许可下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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