- Have a class which confirms to the protocol
<FXForm>
- Have a NSInteger property called language in the class you created in step 1
- In the class you created in step 1 implement the method - (NSArray *)fields. A sample implementation is shown below.
-(NSArray *)fields
{
NSArray *basicFields = @[
@{FXFormFieldKey: @"language",
FXFormFieldOptions: @[@"English", @"Spanish", @"French", @"Dutch"]},
];
NSArray *controlFields = @[
@{FXFormFieldTitle: @"Submit", FXFormFieldAction: @"submitTapped:"},
];
return [basicFields arrayByAddingObjectsFromArray:controlFields];
}
In the view controller you are displaying the form implement the method - (void) submitTapped:(UITableViewCell *)cell as follows.
-(void) submitTapped:(UITableViewCell *)cell
{
YourClassName *form = (YourClassName *)cell.field.form;
}
You could access the language property of the object form to get the selected index path.