Hi ozie,
It looks to work in willConfigure, at least with this code:
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationBarType = SCNavigationBarTypeEditRight;
DGObject *object0 = [[DGObject alloc] initWithNameString:@"ZERO"];
DGObject *object1 = [[DGObject alloc] initWithNameString:@"ONE"];
DGObject *object2 = [[DGObject alloc] initWithNameString:@"TWO"];
NSMutableArray *mutableArray = [NSMutableArray arrayWithObjects:
object0,
object1,
object2,
nil];
SCClassDefinition *classDefinition = [SCClassDefinition definitionWithClass:[DGObject class] propertyNamesString:@"nameString"];
classDefinition.requireEditingModeToEditPropertyValues = YES;
SCPropertyDefinition *propertyDefinition = [classDefinition propertyDefinitionWithName:@"nameString"];
propertyDefinition.type = SCPropertyTypeTextField;
propertyDefinition.title = @"";
SCArrayOfObjectsSection *arrayOfObjectsSection = [SCArrayOfObjectsSection sectionWithHeaderTitle:nil items:mutableArray itemsDefinition:classDefinition];
arrayOfObjectsSection.cellActions.willConfigure = ^(SCTableViewCell *cell, NSIndexPath *indexPath) {
NSLog(@"arrayOfObjectsSection cellActions willConfigure:%li",(long)indexPath.row);
if ([cell.ownerTableViewModel.tableView isEditing]) {
cell.editable = YES;
}
else {
cell.editable = NO;
}
};
[self.tableViewModel addSection:arrayOfObjectsSection];
self.tableViewModel.modelActions.shouldBeginEditing = ^BOOL(SCTableViewModel *tableModel) {
NSLog(@"self tableViewModel modelActions shouldBeginEditing");
return YES;
};
self.tableViewModel.modelActions.shouldEndEditing = ^BOOL(SCTableViewModel *tableModel) {
NSLog(@"self tableViewModel modelActions shouldEndEditing");
return YES;
};
}
And the modelActions get called as well.
DGObject is a class with one property, NSString *nameString.
It looks like willConfigure is called twice for every cell, and then twice again on each change of edit mode.