Skip to content

Instantly share code, notes, and snippets.

@anthonycvella
Created March 7, 2013 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonycvella/5109998 to your computer and use it in GitHub Desktop.
Save anthonycvella/5109998 to your computer and use it in GitHub Desktop.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// Configure the cell...
tableView.separatorStyle= UITableViewCellSeparatorStyleSingleLine;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
switch (indexPath.row) {
case 0:
usernameField = [[UITextField alloc] initWithFrame:CGRectMake(20, 12, 250, 32)];
usernameField.placeholder = @"Email";
usernameField.textColor = [UIColor blackColor];
usernameField.clearButtonMode = UITextFieldViewModeWhileEditing;
usernameField.font = [UIFont fontWithName:@"Helvetica" size:14.0];
[cell.contentView addSubview:usernameField];
break;
case 1:
passwordField = [[UITextField alloc] initWithFrame:CGRectMake(20, 12, 250, 32)];
passwordField.placeholder = @"Password";
passwordField.textColor = [UIColor blackColor];
passwordField.clearButtonMode = UITextFieldViewModeWhileEditing;
passwordField.secureTextEntry = YES;
passwordField.font = [UIFont fontWithName:@"Helvetica" size:14.0];
[cell.contentView addSubview:passwordField];
break;
default:
break;
}
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment