Latest 0.1.7
Homepage https://github.com/ifobos/JRTForm
License MIT
Platforms ios 8.0, requires ARC
Dependencies libPhoneNumber-iOS
Authors

JRTForm is a tool that will help shorten the development time of your forms, without sacrificing the ability to:

1. Easily customize the appearance of the form fields.

  • By customizing a new xib corresponding to a new subclass of the appropriate field, which must contain sub-views required by the form field and outlets properly connected to the references of the parent class.

Demo

2. Introducing custom code to validate the value contained in the fields.

  • Making use of the ā€œsetErrorMessageInValidationBlockā€ method which receives as a parameter a block which in turn receives the value that the user entered in the field and should return a string with the error message that is displayed next to the name field if there is an error with that value, otherwise if the field value is valid block should return nil.
  [textField setErrorMessageInValidationBlock:^NSString *(NSString *stringToValidate)
        {
            NSString *errorMessage          = nil;
            if ([stringToValidate stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]].length == 0)
            {
                errorMessage = @"is required.";
            }
            return errorMessage;
        }];

3. Customizing behavior in interaction with the user interface.

  • By creating a subclass you can access properties (outlets) that refer to elements in the form field interface, allowing programmatically modify. the you implement cell protocols Delegate corresponding to the type of form field, executing a block of code that the cell has the property, these properties are named the same name as the method in which they are executed which is specified in the protocol.
// To implement the - (BOOL)textFieldShouldReturn:(UITextField *)textField 
// method specified in the UITextFieldDelegate  protocol is only necessary 
// to specify a block of code to be executed instead of the method thus only 
// it needs to spend the blocks describing a specific behavior as an argument 
// to a specific instance of the field.

 [textField setShouldReturn:^BOOL(UITextField *textField)
        {
             [textField endEditing:YES];
             return NO;
        }];

Each form field has 3 different states

____Initial____ Invalid ___Valid____

states

Installation

Cocoapod Method:-

JRTForm is available through CocoaPods, to install it simply add the following line to your Podfile:

pod ‘JRTForm’

Source Code Method:-

Just drag and drop JRTForm directory from demo project to your project. That’s it.

Latest podspec

{
    "name": "JRTForm",
    "version": "0.1.7",
    "summary": "JRTForm framework to create forms",
    "homepage": "https://github.com/ifobos/JRTForm",
    "license": "MIT",
    "authors": {
        "ifobos": "[email protected]"
    },
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/ifobos/JRTForm.git",
        "tag": "0.1.7"
    },
    "source_files": "JRTForm/JRTForm/PodFiles/**/*.{h,m}",
    "resources": "JRTForm/JRTForm/PodFiles/**/*.{png,bundle,xib,nib}",
    "requires_arc": true,
    "dependencies": {
        "libPhoneNumber-iOS": []
    }
}

Pin It on Pinterest

Share This