Skip to content
This repository has been archived by the owner on Nov 22, 2020. It is now read-only.

Commit

Permalink
Merge pull request #17 from alanihre/master
Browse files Browse the repository at this point in the history
Text field should not be cleared if delegate selector returns NO
  • Loading branch information
ArtSabintsev committed Jan 11, 2016
2 parents 417ace0 + fc268d2 commit b172ccf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion UIFloatLabelTextField/UIFloatLabelTextField.m
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,10 @@ - (void)clearTextField
{
// Call UITextFieldDelegate's 'textFieldShouldClear' method if delegate is set
if ([self.delegate respondsToSelector:@selector(textFieldShouldClear:)]) {
[self.delegate textFieldShouldClear:self];
BOOL shouldClear = [self.delegate textFieldShouldClear:self];
if (!shouldClear) {
return;
}
}

// Create array, where each index contains one character from textField
Expand Down

0 comments on commit b172ccf

Please sign in to comment.