Skip to content

Commit 1fedc27

Browse files
committed
Minor cleanups
1 parent eeb4cf0 commit 1fedc27

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

TPKeyboardAvoiding/UIScrollView+TPKeyboardAvoidingAdditions.m

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ - (void)TPKeyboardAvoiding_keyboardWillShow:(NSNotification*)notification {
5959

6060
UIView *firstResponder = [self TPKeyboardAvoiding_findFirstResponderBeneathView:self];
6161

62-
if (!firstResponder) {
62+
if ( !firstResponder ) {
6363
return;
6464
}
6565

@@ -88,13 +88,11 @@ - (void)TPKeyboardAvoiding_keyboardWillShow:(NSNotification*)notification {
8888

8989
self.contentInset = [self TPKeyboardAvoiding_contentInsetForKeyboard];
9090

91-
if ( firstResponder ) {
92-
CGFloat viewableHeight = self.bounds.size.height - self.contentInset.top - self.contentInset.bottom;
93-
[self setContentOffset:CGPointMake(self.contentOffset.x,
94-
[self TPKeyboardAvoiding_idealOffsetForView:firstResponder
95-
withViewingAreaHeight:viewableHeight])
96-
animated:NO];
97-
}
91+
CGFloat viewableHeight = self.bounds.size.height - self.contentInset.top - self.contentInset.bottom;
92+
[self setContentOffset:CGPointMake(self.contentOffset.x,
93+
[self TPKeyboardAvoiding_idealOffsetForView:firstResponder
94+
withViewingAreaHeight:viewableHeight])
95+
animated:NO];
9896

9997
self.scrollIndicatorInsets = self.contentInset;
10098

0 commit comments

Comments
 (0)