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

Commit f3f31a7

Browse files
author
Ignacio Romero Zurbuchen
committed
Renaming of APIs
1 parent e7d003a commit f3f31a7

File tree

3 files changed

+21
-21
lines changed

3 files changed

+21
-21
lines changed

Source/SLKTextInputbar.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,12 +123,12 @@ typedef NS_ENUM(NSUInteger, SLKCounterPosition) {
123123
- (void)endTextEdition;
124124

125125
/**
126-
YES if a keyboard snapshot should be shown, replacing the system keyboard.
126+
YES if a keyboard snapshot placeholder should be shown, replacing the system keyboard.
127127
The snapshot is being added as a subview, aligned at the same position the keyboard is, before hiding it momentarily.
128128
129-
@param show YES if a keyboard snapshot should be show and the system keyboard hidden.
129+
@param show YES if a keyboard snapshot placeholder should show instead of the system keyboard.
130130
*/
131-
- (void)showKeyboardSnapshot:(BOOL)show;
131+
- (void)showKeyboardPlaceholder:(BOOL)show;
132132

133133

134134
#pragma mark - Text Counting

Source/SLKTextInputbar.m

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ @interface SLKTextInputbar ()
3939
@property (nonatomic, strong) NSArray *charCountLabelVCs;
4040

4141
@property (nonatomic, strong) UILabel *charCountLabel;
42-
@property (nonatomic, strong) UIView *keyboardMockView;
42+
@property (nonatomic, strong) UIView *keyboardPlaceholderView;
4343

4444
@property (nonatomic) CGPoint previousOrigin;
4545

@@ -539,41 +539,41 @@ - (void)slk_updateCounter
539539
}
540540

541541

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

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

548-
if (!_keyboardMockView && show) {
548+
if (!_keyboardPlaceholderView && show) {
549549

550550
// Takes a snapshot of the keyboard's window
551-
UIView *keyboardSnapshot = [keyboardWindow snapshotViewAfterScreenUpdates:NO];
551+
UIView *snapshotView = [keyboardWindow snapshotViewAfterScreenUpdates:NO];
552552

553553
// Shifts the snapshot up to fit to the bottom
554-
CGRect snapshowFrame = keyboardSnapshot.frame;
554+
CGRect snapshowFrame = snapshotView.frame;
555555
snapshowFrame.origin.y = CGRectGetHeight(self.inputAccessoryView.keyboardViewProxy.frame) - CGRectGetHeight(self.superview.frame);
556-
keyboardSnapshot.frame = snapshowFrame;
556+
snapshotView.frame = snapshowFrame;
557557

558558
CGRect mockframe = self.inputAccessoryView.keyboardViewProxy.frame;
559559
mockframe.origin.y = CGRectGetHeight(self.frame);
560560

561-
_keyboardMockView = [[UIView alloc] initWithFrame:mockframe];
562-
_keyboardMockView.backgroundColor = [UIColor clearColor];
563-
[_keyboardMockView addSubview:keyboardSnapshot];
561+
self.keyboardPlaceholderView = [[UIView alloc] initWithFrame:mockframe];
562+
self.keyboardPlaceholderView.backgroundColor = [UIColor clearColor];
563+
[self.keyboardPlaceholderView addSubview:snapshotView];
564564

565-
// Adds the mock view to the input bar, so when it moves they are glued together
566-
[self addSubview:_keyboardMockView];
565+
// Adds the placeholder view to the input bar, so when it looks they are sticked together.
566+
[self addSubview:self.keyboardPlaceholderView];
567567

568568
// Let's delay hiding the keyboard's window to avoid noticeable glitches
569569
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
570570
keyboardWindow.hidden = YES;
571571
});
572572
}
573-
else if (_keyboardMockView && !show) {
573+
else if (_keyboardPlaceholderView && !show) {
574574

575-
[_keyboardMockView removeFromSuperview];
576-
_keyboardMockView = nil;
575+
[_keyboardPlaceholderView removeFromSuperview];
576+
_keyboardPlaceholderView = nil;
577577

578578
keyboardWindow.hidden = NO;
579579
}

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 showKeyboardSnapshot:YES];
961+
[self.textInputbar showKeyboardPlaceholder: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 showKeyboardSnapshot:NO];
1013+
[self.textInputbar showKeyboardPlaceholder: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 showKeyboardSnapshot:NO];
1053+
[self.textInputbar showKeyboardPlaceholder:NO];
10541054
}
10551055
}];
10561056

0 commit comments

Comments
 (0)