@@ -39,7 +39,7 @@ @interface SLKTextInputbar ()
39
39
@property (nonatomic , strong ) NSArray *charCountLabelVCs;
40
40
41
41
@property (nonatomic , strong ) UILabel *charCountLabel;
42
- @property (nonatomic , strong ) UIView *keyboardMockView ;
42
+ @property (nonatomic , strong ) UIView *keyboardPlaceholderView ;
43
43
44
44
@property (nonatomic ) CGPoint previousOrigin;
45
45
@@ -539,41 +539,41 @@ - (void)slk_updateCounter
539
539
}
540
540
541
541
542
- #pragma mark - Keyboard Snapshot
542
+ #pragma mark - Keyboard Snapshot Placeholder
543
543
544
- - (void )showKeyboardSnapshot : (BOOL )show
544
+ - (void )showKeyboardPlaceholder : (BOOL )show
545
545
{
546
546
UIWindow *keyboardWindow = [self keyboardWindow ];
547
547
548
- if (!_keyboardMockView && show) {
548
+ if (!_keyboardPlaceholderView && show) {
549
549
550
550
// Takes a snapshot of the keyboard's window
551
- UIView *keyboardSnapshot = [keyboardWindow snapshotViewAfterScreenUpdates: NO ];
551
+ UIView *snapshotView = [keyboardWindow snapshotViewAfterScreenUpdates: NO ];
552
552
553
553
// Shifts the snapshot up to fit to the bottom
554
- CGRect snapshowFrame = keyboardSnapshot .frame ;
554
+ CGRect snapshowFrame = snapshotView .frame ;
555
555
snapshowFrame.origin .y = CGRectGetHeight (self.inputAccessoryView .keyboardViewProxy .frame ) - CGRectGetHeight (self.superview .frame );
556
- keyboardSnapshot .frame = snapshowFrame;
556
+ snapshotView .frame = snapshowFrame;
557
557
558
558
CGRect mockframe = self.inputAccessoryView .keyboardViewProxy .frame ;
559
559
mockframe.origin .y = CGRectGetHeight (self.frame );
560
560
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 ];
564
564
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 ];
567
567
568
568
// Let's delay hiding the keyboard's window to avoid noticeable glitches
569
569
dispatch_after (dispatch_time (DISPATCH_TIME_NOW, (int64_t )(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue (), ^{
570
570
keyboardWindow.hidden = YES ;
571
571
});
572
572
}
573
- else if (_keyboardMockView && !show) {
573
+ else if (_keyboardPlaceholderView && !show) {
574
574
575
- [_keyboardMockView removeFromSuperview ];
576
- _keyboardMockView = nil ;
575
+ [_keyboardPlaceholderView removeFromSuperview ];
576
+ _keyboardPlaceholderView = nil ;
577
577
578
578
keyboardWindow.hidden = NO ;
579
579
}
0 commit comments