diff --git a/UIFloatLabelTextField/UIFloatLabelTextField.m b/UIFloatLabelTextField/UIFloatLabelTextField.m index 312af76..5a999c4 100755 --- a/UIFloatLabelTextField/UIFloatLabelTextField.m +++ b/UIFloatLabelTextField/UIFloatLabelTextField.m @@ -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