IBAFormSection * taskSection = [self addSectionWithHeaderTitle:@"Enter new task" footerTitle:nil];
[taskSection addFormField:[[IBATextFormField alloc] initWithKeyPath:kTask title:@"Task"]];
NSArray *dayOptions = [IBAPickListFormOption pickListOptionsForStrings:[NSArray arrayWithObjects:
@"Sunday",
@"Monday",
@"Tuesday",
@"Wedneasday",
@"Thursday",
@"Friday",
@"Saturday",
nil]];
IBASingleIndexTransformer *dayTransformer = [[IBASingleIndexTransformer alloc] initWithPickListOptions:dayOptions];
[taskSection addFormField:[[IBAPickListFormField alloc] initWithKeyPath:kDay
title:@"Day"
valueTransformer:dayTransformer
selectionMode:IBAPickListSelectionModeSingle
options:dayOptions]];
NSArray *timeOptions = [IBAPickListFormOption pickListOptionsForStrings:[NSArray arrayWithObjects:
@"1 Minute",
@"2 Minute",
@"3 Minute",
@"4 Minute",
@"5 Minute",
nil]];
IBASingleIndexTransformer *timeTransformer = [[IBASingleIndexTransformer alloc] initWithPickListOptions:timeOptions];
[taskSection addFormField:[[IBAPickListFormField alloc] initWithKeyPath:kTimeRequired
title:@"Time"
valueTransformer:timeTransformer
selectionMode:IBAPickListSelectionModeSingle
options:timeOptions]];
FormViewController
- (void)loadView
{
[super loadView];
UIView *view = [[UIView alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
[view setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
UITableView *formTableView = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] bounds] style:UITableViewStyleGrouped];
[formTableView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
[self setTableView:formTableView];
[view addSubview:formTableView];
[self setView:view];
}
- (void)viewDidLoad
{
TaskDataSource *dataSource = [[TaskDataSource alloc] initWithModel:_task];
[self setFormDataSource: dataSource];
self.tableView.backgroundColor = [UIColor clearColor];
self.tableView.separatorColor = [UIColor colorWithHexString:@"0033FF"];
self.title = @"Add Task";
}
--
You received this message because you are subscribed to the Google Groups "IBAForms" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ibaforms+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.