• Stars
    star
    272
  • Rank 146,289 (Top 3 %)
  • Language
    Objective-C
  • License
    Apache License 2.0
  • Created almost 12 years ago
  • Updated about 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Not maintained anymore

FormKit.m

FormKit.m is a library that helps building forms with a table view.

It also handles synchronization of data between your model and the view (cells) when the user makes edits.

Everything looks good on iPhone and iPad for iOS versions 6+.

Installation

Copy FormKit dir into your project.

Or with CocoaPods

pod 'FormKit.m'

Example code

self.formModel = [FKFormModel formTableModelForTableView:self.tableView navigationController:self.navigationController];

self.formModel.labelTextColor = [UIColor blackColor];
self.formModel.valueTextColor = [UIColor lightGrayColor];
  
[FKFormMapping mappingForClass:[Movie class] block:^(FKFormMapping *mapping) {
    [mapping sectionWithTitle:@"Information section" identifier:@"info"];
    [mapping mapAttribute:@"title" title:@"Title" type:FKFormAttributeMappingTypeText];
    [mapping mapAttribute:@"releaseDate" title:@"ReleaseDate" type:FKFormAttributeMappingTypeDate];
    [mapping mapAttribute:@"suitAllAges" title:@"All ages" type:FKFormAttributeMappingTypeBoolean];
    
    // Read-only field
    [mapping mapAttribute:@"shortName" title:@"ShortName" type:FKFormAttributeMappingTypeLabel];
    
    [mapping mapAttribute:@"numberOfActor" title:@"Number of actor" type:FKFormAttributeMappingTypeInteger];
    [mapping mapAttribute:@"content" title:@"Content" type:FKFormAttributeMappingTypeBigText];
    
    // Select fields using a picker or pushing a selection view controller
    [mapping mapAttribute:@"choice"
                        title:@"Choices"
                 showInPicker:NO
            selectValuesBlock:^NSArray *(id value, id object, NSInteger *selectedValueIndex){
                *selectedValueIndex = 1;
                return [NSArray arrayWithObjects:@"choice1", @"choice2", nil];
    } valueFromSelectBlock:^id(id value, id object, NSInteger selectedValueIndex) {
        return value;
    } labelValueBlock:^id(id value, id object) {
        return value;
    }];
    
    [mapping buttonSave:@"Save" handler:^{
    }];
    
    [self.formModel registerMapping:mapping];
}];

[self.formModel loadFieldsWithObject:movie];

Form Mapping

Validation

[formMapping validationForAttribute:@"title" validBlock:^BOOL(NSString *value, id object) {
  return value.length < 10;
} errorMessageBlock:^NSString *(id value, id object) {
  return @"Text is too long.";
}];

Contact

Bruno Wernimont

Contributors

Bitdeli Badge

More Repositories

1

BWStatusBarOverlay

BWStatusBarOverlay is a custom status bar overlay window.
Objective-C
328
star
2

NoteItIOS

Ios markdown notebook
Objective-C
292
star
3

BaseKit

BaseKit is a set of IOS class to make your life easier.
Objective-C
265
star
4

BWObjectMapping

Small library that parse almost automatically JSON and map it to any object, works with NSManagedObject.
Objective-C
128
star
5

BWTitlePagerView

Recreate the Twitter navigation controller pager.
Objective-C
114
star
6

TableKit.m

Create table view with blocks based syntax.
Objective-C
50
star
7

ITWLoadingPanel

Drop in classes for adding a download info panel
Objective-C
15
star
8

BWAFNetworking

Restfull http library inspired by the great RestKit and based on top of Afnetworking.
Objective-C
14
star
9

BWSelectViewController

Controller that show a list of items that can be selectable.
Objective-C
12
star
10

BWObjectSerializer

Small library that transform an object into a dictionary that can be send to a web service.
Objective-C
10
star
11

SwiftUILocalNotification

How to embed a SwiftUI view in Notification Content Extension
Swift
7
star
12

BWLongTextViewController

Simple IOS controller that show a full screen textView with keyboard
Objective-C
6
star
13

sammy-rails

This gem provides a generator to install Sammy and his plugin into your Rails 3 application.
Ruby
5
star
14

BWObjectRouter

Small library that generate route with static or dynamic data.
Objective-C
5
star
15

DroneVR

iOS Parrot bebop app
Swift
2
star
16

raicebook

This gem add a lot of usefull facebook helper for rails
Ruby
2
star
17

BWAttributedString

BWAttributedString
Objective-C
1
star
18

easymin

Ruby
1
star
19

ITWSyncController

ITWSyncController is a class that help you to manage app synchronization.
Objective-C
1
star
20

wadmin

Free html5 css3 admin template
1
star
21

rails-template

Rails template script for creating rails app
Ruby
1
star
22

TTRemoteDataExample

Demonstrate how to load image, XML and JSON with Three20 for the iPhone
Objective-C
1
star
23

bwafnetworking_server

Ruby
1
star
24

updated_after

Ruby
1
star
25

TTTableViewControllerExample

Simple example of table view controller with three20
Objective-C
1
star
26

TTPostControllerExample

Demonstrate how to play with TTPostController composer
Objective-C
1
star