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

Commit 797b232

Browse files
author
Ignacio Romero Zurbuchen
committed
Renames method for replacing the keyboard with snapshot
1 parent 589223c commit 797b232

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
@@ -123,14 +123,13 @@ typedef NS_ENUM(NSUInteger, SLKCounterPosition) {
123123
*/
124124
- (void)endTextEdition;
125125

126-
127126
/**
128-
YES if a keyboard screenshot should be shown, replacing the keyboard area.
129-
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.
127+
YES if a keyboard snapshot should be shown, replacing the system keyboard.
128+
The snapshot is being added as a subview, aligned at the same position the keyboard is, before hiding it momentarily.
130129
131-
@param show YES if a keyboard screenshot should be show.
130+
@param show YES if a keyboard snapshot should be show and the system keyboard hidden.
132131
*/
133-
- (void)showKeyboardMockup:(BOOL)show;
132+
- (void)showKeyboardSnapshot:(BOOL)show;
134133

135134

136135
#pragma mark - Text Counting

Source/SLKTextInputbar.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,9 +535,9 @@ - (void)slk_updateCounter
535535
}
536536

537537

538-
#pragma mark - Keyboard Mockup
538+
#pragma mark - Keyboard Snapshot
539539

540-
- (void)showKeyboardMockup:(BOOL)show
540+
- (void)showKeyboardSnapshot:(BOOL)show
541541
{
542542
UIWindow *keyboardWindow = [self keyboardWindow];
543543

Source/SLKTextViewController.m

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

942942
originalFrame = keyboardView.frame;
@@ -988,7 +988,7 @@ - (void)slk_didPanTextInputBar:(UIPanGestureRecognizer *)gesture
988988

989989
if (!dragging) {
990990
if (SLK_IS_IOS9_AND_HIGHER) {
991-
[self.textInputbar showKeyboardMockup:NO];
991+
[self.textInputbar showKeyboardSnapshot:NO];
992992
}
993993

994994
break;
@@ -1028,7 +1028,7 @@ - (void)slk_didPanTextInputBar:(UIPanGestureRecognizer *)gesture
10281028
self.movingKeyboard = NO;
10291029

10301030
if (SLK_IS_IOS9_AND_HIGHER) {
1031-
[self.textInputbar showKeyboardMockup:NO];
1031+
[self.textInputbar showKeyboardSnapshot:NO];
10321032
}
10331033
}];
10341034

0 commit comments

Comments
 (0)