TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Jérôme Morissard.
JMFormDescription is an Objective-C library for easily creating forms on iOS.
To create a form object
JMTextfieldFormViewDescription *textfieldDesc = [JMTextfieldFormViewDescription new];
textfieldDesc.placeholder = @"Mon placeholder";
textfieldDesc.data = model.textfieldText1;
textfieldDesc.formDelegate = self;
textfieldDesc.modelKey = @"textfieldText1";
Create a formDescription to describe all your formViews and call JMScrollView instance method
- (void)reloadScrollViewWithFormDescription:(NSArray *)descriptions
- (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;
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;
};
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]];