Skip to content

Commit

Permalink
Fixed an issue that was preventing floating label textfields to displ…
Browse files Browse the repository at this point in the history
…ay the info cell
  • Loading branch information
bpoplauschi committed Mar 13, 2014
1 parent 6eee6bd commit 01676aa
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions BPForms/BPFormViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSIntege

#pragma mark - UITextFieldDelegate
- (void)textFieldDidBeginEditing:(UITextField *)textField {
BPFormInputCell *cell = nil;
if ([textField isKindOfClass:[BPFormTextField class]]) {
cell = [textField containerInputCell];
}
BPFormInputCell *cell = [textField containerInputCell];
if (!cell) {
return;
}
Expand All @@ -231,10 +228,8 @@ - (void)textFieldDidBeginEditing:(UITextField *)textField {

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
BOOL shouldChange = YES;
BPFormInputCell *cell = nil;
if ([textField isKindOfClass:[BPFormTextField class]]) {
cell = [textField containerInputCell];
}
BPFormInputCell *cell = [textField containerInputCell];

if (!cell) {
return YES;
}
Expand All @@ -250,10 +245,7 @@ - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRang
}

- (void)textFieldDidEndEditing:(UITextField *)textField {
BPFormInputCell *cell = nil;
if ([textField isKindOfClass:[BPFormTextField class]]) {
cell = [textField containerInputCell];
}
BPFormInputCell *cell = [textField containerInputCell];
if (!cell) {
return;
}
Expand All @@ -270,13 +262,9 @@ - (void)textFieldDidEndEditing:(UITextField *)textField {
[self updateInfoCellBelowInputCell:cell];
[cell updateAccordingToValidationState];
}

- (BOOL)textFieldShouldReturn:(UITextField *)textField {
BOOL shouldReturn = YES;
BPFormInputCell *cell = nil;
if ([textField isKindOfClass:[BPFormTextField class]]) {
cell = [textField containerInputCell];
}
BPFormInputCell *cell = [textField containerInputCell];
if (!cell) {
return YES;
}
Expand Down

0 comments on commit 01676aa

Please sign in to comment.