Latest 1.1.8
Homepage https://github.com/vibze/DARFormBuilder
License LICENSE
Platforms ios 9.0, requires ARC
Authors

Library made to cut corners when making complex forms using UITableView.

Installation using cocoapods

Add pod DARFormBuilder to your podfile and run pod install

How to use

  1. Instantiate a FormController

    let formController = FormController()
  2. Add it to your controller’s view:

    override func viewDidLoad() {
        super.viewDidLoad()
    
        view.addSubview(formController.view)
        formController.view.frame = view.bounds
    }    
  3. Configure your form fields

    formController.items = [
    
    // Plain text with big font
    TitleCell(text: "Title", fontSize: 30),
    
    // Plain text with small font
    DescriptionCell(text: "Your top client is Ice Cream Shop, Inc. Their ice cream is so popular they can’t keep up with customer orders at the counter. They’ve recruited you to create a sleek iOS app that will allow customers to order ice cream right from their phone. You’ve started developing the app, and it’s coming along well.", fontSize: 12),
    
    // Static value with label on the left and value on the right
    StaticValueCell(label: "Price", value: "1000"),
    
    // Label on the left and a number with plus and minus buttons on the right
    NumDialInputCell(label: "Amount", value: 5, range: 1..<25) { amount in
    
    }),
    
    // Basic text input cell without label
    TextInputCell(text: "Name", placeholder: "Letters, words", keyboardType: .default, maxLength: 30) { text in
    
    }),
    
    // Date input cell without label
    DateInputCell(label: "Birthday", value: Date()) { date in
    
    }),
    
    // Labeled switch input cell
    SwitchInputCell(label: "Yes/No?", value: true) { value in 
    
    })
    
    // Clickable cell with disclosure indicator
    ClickableCell(label: "Click me") {
    
    }
    
    // Custom view cell
    CustomViewCell(customView: UIImageView(image: xxx"))
    ]

List of available cell types

TitleCell

Cell for displaying form titles. Big font, contrasty color.

DescriptionCell

Cell for displaying long texts as descriptions or field clarifications.

StaticValueCell

Label and value for displaying static properties.

NumDialInputCell

Label with number dial. Values can be limited by range.

TextInputCell

Simple textView cell. Can be limited by max length.

TextFieldInputCell

Simple textField cell. Can be limited by max length.

DateInputCell

Date picker cell.

SwitchInputCell

Label with switch view on the right.

ClickableCell

Label with disclosure indicator. Clickable.

CustomViewCell

In case you want to display a custom view in a cell. Use auto-layout to stretch contentView.

Latest podspec

{
    "name": "DARFormBuilder",
    "platforms": {
        "ios": "9.0"
    },
    "version": "1.1.8",
    "summary": "A library created to build forms faster",
    "description": "Uses UITableVIew and a set of cells to construct a form for any requirement.",
    "homepage": "https://github.com/vibze/DARFormBuilder",
    "license": "LICENSE",
    "authors": {
        "Viktor Ten": "[email protected]"
    },
    "social_media_url": "https://github.com/vibze",
    "source": {
        "git": "https://github.com/vibze/DARFormBuilder.git",
        "tag": "1.1.8"
    },
    "source_files": "DARFormBuilder/**/*.{swift}",
    "exclude_files": [
        "DARFormBuilderExample/**/*",
        "DARFormBuilderExampleUITests/**/*"
    ],
    "requires_arc": true,
    "pushed_with_swift_version": "3.2"
}

Pin It on Pinterest

Share This