Welcome, Guest
Username Password: Remember me
  • Page:
  • 1

TOPIC: Password Cell?

Password Cell? 1 year, 5 months ago #1

Is there a way to have a TextField cell operate like a password entry item? (Reveal the last letter, then put in the big black dots)

Thanks
  • ulfie22
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Karma: 0

Re: Password Cell? 1 year, 5 months ago #2

Sure Andy:

 
...
SCTextFieldCell *cell = [SCTextFieldCell ...];
cell.textField.secureTextEntry = TRUE;
...
 


Hope this helps!
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: Password Cell? 1 year, 5 months ago #3

Tarek -

Works perfectly. Thanks for your help.
  • ulfie22
  • OFFLINE
  • Fresh Boarder
  • Posts: 9
  • Karma: 0

Re: Password Cell? 3 months ago #4

I'm trying to do the same thing but don't really know where you can access the cell object directly to set the security.

This is what I have so far:

 
// Create Task class definition
SCClassDefinition *userClassDef = [SCClassDefinition definitionWithClass:[User class]
withPropertyNames:[NSArray arrayWithObjects:@"username", @"password", nil]];
 
SCPropertyDefinition *usernamePropertyDef = [userClassDef propertyDefinitionWithName:@"username"];
usernamePropertyDef.required = YES;
usernamePropertyDef.type = SCPropertyTypeTextField;
 
SCPropertyDefinition *passwordPropertyDef = [userClassDef propertyDefinitionWithName:@"password"];
passwordPropertyDef.required = YES;
passwordPropertyDef.type = SCPropertyTypeTextField;
 
// Initialize tableModel
tableModel = [[SCTableViewModel alloc] initWithTableView:self.tableView withViewController:self];
 
SCObjectSection *userSection = [SCObjectSection sectionWithHeaderTitle:@"login" withBoundObject:self.user withClassDefinition:userClassDef];
userSection.headerTitle = nil;
userSection.footerTitle = nil;
userSection.headerView = [[UIView alloc] initWithFrame:CGRectZero];
userSection.footerView = [[UIView alloc] initWithFrame:CGRectZero];
 
tableView.backgroundColor = [UIColor clearColor];
tableView.backgroundView = [[UIView alloc] initWithFrame:CGRectZero];
 
[tableModel addSection:userSection];
 
  • justgabit
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
  • Karma: 1

Re: Password Cell? 3 months ago #5

OK, sort of figured it out on my own. I had to implement the SCTableViewModelDelegate and then add the following method to my controller:


 
#pragma mark - SCTableViewModelDelegate
- (void)tableViewModel:(SCTableViewModel *)tableViewModel
willConfigureCell:(SCTableViewCell *)cell
forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 1) {
SCTextFieldCell *passwordCell = (SCTextFieldCell*) cell;
passwordCell.textField.secureTextEntry = YES;
}
}
 
  • justgabit
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
  • Karma: 1
  • Page:
  • 1
Time to create page: 1.74 seconds