The most flexible and powerful way to build a form on iOS
FORMLayout
uses the collectionView
bounds instead of the mainScreen
bounds (#353)FORMEmailFormatter
, now email fields will not accept commas \o/ (#358)Others:
Huge thanks to @Mutix for his contributions on this release, a big round of applause for him.
Hi again, we hope you're all having a fantastic week. On this release some very nice things were added, thanks a lot to @Mutix for this incredible contributions and taking Form from cool to awesome. Also thanks to @charbelhass who's been reporting issues and more importantly following them. Well that's it, let's get with the changelog.
date
field types, now we also have support for time
and date_time
, just add any of this to your field type and everything should just work (#333)pod install
(#339)Get it by running:
pod update Form
max_value
and min_value
not working => https://github.com/hyperoslo/Form/pull/327
Get it by running
pod update Form
Get it by running
pod update Form
You just have to add the hidden
flag to a field in your JSON file:
{
"id": "first_name",
"hidden": true
}
If you want to show the field you can use a show field target:
[self.dataSource processTargets:@[FORMTarget showFieldTargetWithID:@"first_name"]]
Get it by running
pod update Form
FORMGroupHeaderView
or to customize the existing one// FORMDataSource.h
typedef UICollectionReusableView * (^FORMConfigureGroupHeaderForItemAtIndexPathBlock)(FORMGroup *group,
UICollectionView *collectionView,
NSIndexPath *indexPath);
/*!
* Provides a configuration block to optionally set up subclasses of @c FORMBaseFieldCell
* the default behaviour just sets the field property to the cell.
*/
@property (nonatomic, copy) FORMConfigureCellBlock configureCellBlock;
The only requisite is that this view should be a subclass of UICollectionReusableView
This bug was introduced on 3.0.0 when refactoring FORMLayout
message
)subtitile
to info
everywhere to improve consistency- (NSDictionary *)valuesDictionary;
forms
to groups
- (NSArray *)forms;
- (NSArray *)groups;
invalidFormFields
returns a NSDictionary
instead of a NSArray
- (NSArray *)invalidFormFields;
- (NSDictionary *)invalidFormFields;
reset
, before it wasn't working as expected and it was renamed from resetForms
@property (nonatomic, copy) FORMFieldConfigureCellBlock configureCellBlock;
@property (nonatomic, copy) FORMFieldConfigureHeaderViewBlock configureHeaderViewBlock;
@property (nonatomic, copy) FORMFieldConfigureFieldUpdatedBlock configureFieldUpdatedBlock;
@property (nonatomic, copy) FORMFieldConfigureCellForItemAtIndexPath configureCellForIndexPath;
/*!
* Provides a configuration block to optionally set up subclasses of @c FORMBaseFieldCell
* the default behaviour just sets the field property to the cell.
*/
@property (nonatomic, copy) FORMConfigureCellBlock configureCellBlock;
/*!
* Provides a configuration block to optionally modify the group header view an instance of @c FORMGroupHeaderView
* the default behaviour just sets the title and the delegate.
*/
@property (nonatomic, copy) FORMConfigureHeaderViewBlock configureHeaderViewBlock;
/*!
* Provides a configuration block to optionally return a cell for a specific @c NSIndexPath
* very useful when providing custom cells.
*/
@property (nonatomic, copy) FORMConfigureCellForItemAtIndexPathBlock configureCellForItemAtIndexPathBlock;
/*!
* Provides a block that gets called every time a field gets updated
*/
@property (nonatomic, copy) FORMFieldFieldUpdatedBlock fieldUpdatedBlock;
- (void)processTarget:(FORMTarget *)target;
Use - (void)processTargets:(NSArray *)targets;
instead- (NSArray *)invalidFormFields;
- (NSDictionary *)requiredFormFields;
- (BOOL)formFieldsAreValid;
- (void)resetForms;
- (void)validateForms;
- (CGSize)sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
- (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths;
/*!
* @discussion A method to retrieve invalid fields.
* @return A dictionary of invalid fields where the key is the @c fieldID and the value the @c FORMField.
*/
- (NSDictionary *)invalidFields;
/*!
* @discussion A method to retrieve required fields.
* @return A dictionary of required fields where the key is the @c fieldID and the value the @c FORMField.
*/
- (NSDictionary *)requiredFields;
/*!
* @return @YES if all the fields are valid
*/
- (BOOL)isValid;
/*!
* Resets the values of all the fields
*/
- (void)reset;
/*!
* Runs @c validate in all the fields, if the field is invalid it will show as red
*/
- (void)validate;
/*!
* @return The size for the @c field at the given @c indexPath
*/
- (CGSize)sizeForFieldAtIndexPath:(NSIndexPath *)indexPath;
/*!
* @discussion Safely reloads the fields at the given indexPaths
* @param indexPaths A collection of indexPaths to reload
*/
- (void)reloadFieldsAtIndexPaths:(NSArray *)indexPaths;
We want to thank @matteocrippa for his contributions on this release :heart: :bouquet:
Note: We are going to continue to be very strict in following semantic versioning.
Adding
message
to aFORMField
now will display a tooltip when the field it's activated (becomes first responder). We refactored the tooltip so it works better, faster and stronger.
resetDynamicSectionsWithDictionary
to FORMDataSource
This is useful when you need to reset the state of dynamic sections