Latest 0.0.3
Homepage https://github.com/leverdeterre/JMFormDescription
License MIT
Platforms ios 6.0, requires ARC
Frameworks UIKit
Authors

My other works

[http://leverdeterre.github.io] (http://leverdeterre.github.io)

JMFormDescription

JMFormDescription is an Objective-C library for easily creating forms on iOS.

Image

Creating a form element (JMFormView)

To create a form object

    JMTextfieldFormViewDescription *textfieldDesc  = [JMTextfieldFormViewDescription new];
    textfieldDesc.placeholder = @"Mon placeholder";
    textfieldDesc.data = model.textfieldText1;
    textfieldDesc.formDelegate = self;
    textfieldDesc.modelKey = @"textfieldText1";

Supported formViews

  • JMFormSectionHeaderFormView (to simulate a section header),
  • JMTextfieldFormView,
  • JMTextfieldWithTitleFormView,
  • JMSwitchFormView,
  • JMButtonFormView,
  • JMListFormView,
  • JMTextViewFormView.

Creating a form (JMFormScrollView)

Create a formDescription to describe all your formViews and call JMScrollView instance method

- (void)reloadScrollViewWithFormDescription:(NSArray *)descriptions

FormView actions, methods, updates

Delegation (JMFormDelegate)

- (void)textUpdatedFromFormView:(JMTextfieldFormView *)formView textfield:(UITextField *)textfield toText:(NSString *)text;
- (void)textUpdatedFromFormView:(JMTextViewFormView *)formView textView:(UITextView *)textView toText:(NSString *)text;
- (void)switchChangedFromFormView:(JMSwitchFormView *)formView toValue:(BOOL)value;
- (void)buttonPressedFromFormView:(JMButtonFormView *)formView withTitleValue:(NSString *)value;
- (void)listPressedFromFormView:(JMListFormView *)formView withSelectedValue:(NSString *)value;
- (void)selectedChoice:(NSString *)choice forModelKey:(NSString *)modelKey;
- (void)scrollToFormView:(JMFormView *)formView;

Blocks (JMFormViewCompltionBlock)

formDescription can contains your update methods !

JMTextfieldFormViewDescription *textfieldDesc = [JMTextfieldFormViewDescription new];
textfieldDesc.placeholder = @"Mon placeholder4";
textfieldDesc.data = model.maValeur;
textfieldDesc.completionBlock = ^(id modifiedValue){
     model.maValeur = modifiedValue;
};

FormView UIAppearance

JMFormView can be customize using UIAppearance protocol.

[[JMFormView appearance] setFormViewBackgroundColor:[UIColor colorWithRed:219.0/255 green:214.0/255 blue:208/255 alpha:1.0]];
[[JMTextfieldFormView appearance] setFormViewTextfieldFont:[UIFont fontWithName:@"HelveticaNeue-Regular" size:16.0f]];
[[JMTextfieldFormView appearance] setFormViewTextfieldTextColor:[UIColor blackColor]];

[[JMTextfieldWithTitleFormView appearance] setFormViewTitleFont:[UIFont fontWithName:@"HelveticaNeue-Thin" size:16.0f]];
[[JMFormSectionHeaderFormView appearance] setFormViewHeaderLabelFont:[UIFont fontWithName:@"HelveticaNeue-Thin" size:25.0f]];
[[JMFormSectionHeaderFormView appearance] setFormViewHeaderBackgroundColor:[UIColor whiteColor]];

[[JMButtonFormView appearance] setFormViewButtonTitleColor:[UIColor whiteColor]];
[[JMButtonFormView appearance] setFormViewButtonBackgroundColor:[UIColor blackColor]];
[[JMButtonFormView appearance] setFormViewButtonTitleFont:[UIFont fontWithName:@"HelveticaNeue-Regular" size:16.0f]];

[[JMSwitchFormView appearance] setFormViewTitleFont:[UIFont fontWithName:@"HelveticaNeue-Thin" size:15.0f]];
[[JMSwitchFormView appearance] setFormViewSwitchTintColor:[UIColor purpleColor]];

Todo

  • Add PickerFormView,
  • Add DatePickerFormView,
  • Keyboard type,
  • Textfield Regex to validate input,
  • Implement dynamic reload, insertions, deletions.

Latest podspec

{
    "name": "JMFormDescription",
    "version": "0.0.3",
    "summary": "JMFormDescription is an iOS library for easily manage complex Form.",
    "requires_arc": true,
    "description": "                   JMFormDescription is an Objective-C library for easily creating and manage complex structured Form.n                   * A new way to your layout in a very simple method,n                   * Datasource / Delegate considerably simplified and focus on manipulated objet, no indexPath!n                   * Next/Previous/Done inpoutAccesoryView for TextField and TextView.n",
    "homepage": "https://github.com/leverdeterre/JMFormDescription",
    "screenshots": [
        "https://raw.githubusercontent.com/leverdeterre/JMFormDescription/master/screenshots/demo1.png",
        "https://raw.githubusercontent.com/leverdeterre/JMFormDescription/master/screenshots/demo2.png",
        "https://raw.githubusercontent.com/leverdeterre/JMFormDescription/master/screenshots/demo3.png"
    ],
    "license": "MIT",
    "authors": {
        "jerome Morissard": "[email protected]"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source": {
        "git": "https://github.com/leverdeterre/JMFormDescription.git",
        "tag": "0.0.3"
    },
    "source_files": [
        "Classes",
        "JMFormDescription/JMFormDescription/*.{h,m}"
    ],
    "public_header_files": "JMFormDescription/JMFormDescription/*.h",
    "resources": "JMFormDescription/JMFormDescription/*.xib",
    "frameworks": "UIKit"
}

Pin It on Pinterest

Share This