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

Commit 6f6227a

Browse files
author
Ignacio Romero Zurbuchen
committed
Renames method for replacing the keyboard with snapshot
1 parent b63b7aa commit 6f6227a

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
@@ -524,9 +524,9 @@ - (void)slk_updateCounter
524524
}
525525

526526

527-
#pragma mark - Keyboard Mockup
527+
#pragma mark - Keyboard Snapshot
528528

529-
- (void)showKeyboardMockup:(BOOL)show
529+
- (void)showKeyboardSnapshot:(BOOL)show
530530
{
531531
UIWindow *keyboardWindow = [self keyboardWindow];
532532

Source/SLKTextViewController.m

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

952952
originalFrame = keyboardView.frame;
@@ -998,7 +998,7 @@ - (void)slk_didPanTextInputBar:(UIPanGestureRecognizer *)gesture
998998

999999
if (!dragging) {
10001000
if (SLK_IS_IOS9_AND_HIGHER) {
1001-
[self.textInputbar showKeyboardMockup:NO];
1001+
[self.textInputbar showKeyboardSnapshot:NO];
10021002
}
10031003

10041004
break;
@@ -1038,7 +1038,7 @@ - (void)slk_didPanTextInputBar:(UIPanGestureRecognizer *)gesture
10381038
self.movingKeyboard = NO;
10391039

10401040
if (SLK_IS_IOS9_AND_HIGHER) {
1041-
[self.textInputbar showKeyboardMockup:NO];
1041+
[self.textInputbar showKeyboardSnapshot:NO];
10421042
}
10431043
}];
10441044

0 commit comments

Comments
 (0)