Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

Commit e7d003a

Browse files
author
Ignacio Romero Zurbuchen
committed
Renames method for replacing the keyboard with snapshot
1 parent 63e032e commit e7d003a

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

Source/SLKTextInputbar.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,13 @@ typedef NS_ENUM(NSUInteger, SLKCounterPosition) {
122122
*/
123123
- (void)endTextEdition;
124124

125-
126125
/**
127-
YES if a keyboard screenshot should be shown, replacing the keyboard area.
128-
Since the keyboard is on its own view hierarchy since iOS 9, this is an easy technique to achieve the effect for dragging keyboard being moved together with the text input bar.
126+
YES if a keyboard snapshot should be shown, replacing the system keyboard.
127+
The snapshot is being added as a subview, aligned at the same position the keyboard is, before hiding it momentarily.
129128
130-
@param show YES if a keyboard screenshot should be show.
129+
@param show YES if a keyboard snapshot should be show and the system keyboard hidden.
131130
*/
132-
- (void)showKeyboardMockup:(BOOL)show;
131+
- (void)showKeyboardSnapshot:(BOOL)show;
133132

134133

135134
#pragma mark - Text Counting

Source/SLKTextInputbar.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,9 @@ - (void)slk_updateCounter
539539
}
540540

541541

542-
#pragma mark - Keyboard Mockup
542+
#pragma mark - Keyboard Snapshot
543543

544-
- (void)showKeyboardMockup:(BOOL)show
544+
- (void)showKeyboardSnapshot:(BOOL)show
545545
{
546546
UIWindow *keyboardWindow = [self keyboardWindow];
547547

Source/SLKTextViewController.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ - (void)slk_didPanTextInputBar:(UIPanGestureRecognizer *)gesture
958958
// we instead show a snapshot of the keyboard and hide it
959959
// to give the illusion that the keyboard is being moved by the user.
960960
if (SLK_IS_IOS9_AND_HIGHER && gestureVelocity.y > 0) {
961-
[self.textInputbar showKeyboardMockup:YES];
961+
[self.textInputbar showKeyboardSnapshot:YES];
962962
}
963963

964964
originalFrame = keyboardView.frame;
@@ -1010,7 +1010,7 @@ - (void)slk_didPanTextInputBar:(UIPanGestureRecognizer *)gesture
10101010

10111011
if (!dragging) {
10121012
if (SLK_IS_IOS9_AND_HIGHER) {
1013-
[self.textInputbar showKeyboardMockup:NO];
1013+
[self.textInputbar showKeyboardSnapshot:NO];
10141014
}
10151015

10161016
break;
@@ -1050,7 +1050,7 @@ - (void)slk_didPanTextInputBar:(UIPanGestureRecognizer *)gesture
10501050
self.movingKeyboard = NO;
10511051

10521052
if (SLK_IS_IOS9_AND_HIGHER) {
1053-
[self.textInputbar showKeyboardMockup:NO];
1053+
[self.textInputbar showKeyboardSnapshot:NO];
10541054
}
10551055
}];
10561056

0 commit comments

Comments
 (0)