From 97339641b39158aa98cfb1c9a442ddfa9d67ec4d Mon Sep 17 00:00:00 2001 From: Krzysztof Moczala Date: Mon, 12 Jan 2015 15:20:47 +0100 Subject: [PATCH] fixed - enable doesn't work with textView --- IQKeyBoardManager/IQKeyboardManager.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/IQKeyBoardManager/IQKeyboardManager.m b/IQKeyBoardManager/IQKeyboardManager.m index 1fe52d8ed..88fb19c6a 100755 --- a/IQKeyBoardManager/IQKeyboardManager.m +++ b/IQKeyBoardManager/IQKeyboardManager.m @@ -928,6 +928,9 @@ -(void)textFieldViewDidBeginEditing:(NSNotification*)notification { _IQShowLog([NSString stringWithFormat:@"****** %@ started ******",NSStringFromSelector(_cmd)]); + //If not enabled then do nothing. + if (_enable == NO) return; + // Getting object _textFieldView = notification.object; @@ -1001,6 +1004,9 @@ -(void)textFieldViewDidEndEditing:(NSNotification*)notification { _IQShowLog([NSString stringWithFormat:@"****** %@ started ******",NSStringFromSelector(_cmd)]); + //If not enabled then do nothing. + if (_enable == NO) return; + [_textFieldView.window removeGestureRecognizer:_tapGesture]; // (Enhancement ID: #14) // We check if there's a change in original frame or not. @@ -1027,6 +1033,9 @@ -(void)textFieldViewDidChange:(NSNotification*)notification // (Bug ID: #18) { UITextView *textView = (UITextView *)notification.object; + //If not enabled then do nothing. + if (_enable == NO) return; + CGRect line = [textView caretRectForPosition: textView.selectedTextRange.start]; CGFloat overflow = CGRectGetMaxY(line) - (textView.contentOffset.y + CGRectGetHeight(textView.bounds) - textView.contentInset.bottom - textView.contentInset.top);