This repository was archived by the owner on Oct 30, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1365,6 +1365,9 @@ - (void)slk_willShowOrHideKeyboard:(NSNotification *)notification
1365
1365
[self slk_hideAutoCompletionViewIfNeeded ];
1366
1366
}
1367
1367
1368
+ // store the previous keyboard height
1369
+ CGFloat preKeyboardHeight = self.keyboardHC .constant ;
1370
+
1368
1371
// Updates the height constraints' constants
1369
1372
self.keyboardHC .constant = [self slk_appropriateKeyboardHeightFromNotification: notification];
1370
1373
self.scrollViewHC .constant = [self slk_appropriateScrollViewHeight ];
@@ -1390,7 +1393,8 @@ - (void)slk_willShowOrHideKeyboard:(NSNotification *)notification
1390
1393
1391
1394
// Begin and end frames are the same when the keyboard is shown during navigation controller's push animation.
1392
1395
// The animation happens in window coordinates (slides from right to left) but doesn't in the view controller's view coordinates.
1393
- if (!CGRectEqualToRect (beginFrame, endFrame))
1396
+ // Second condition: check if the height of the keyboard changed.
1397
+ if (!CGRectEqualToRect (beginFrame, endFrame) || fabs (preKeyboardHeight - self.keyboardHC .constant ) >= FLT_EPSILON)
1394
1398
{
1395
1399
// Only for this animation, we set bo to bounce since we want to give the impression that the text input is glued to the keyboard.
1396
1400
[self .view slk_animateLayoutIfNeededWithDuration: duration
You can’t perform that action at this time.
0 commit comments