Skip to content

Commit 5c49393

Browse files
author
ignacio
committed
Renames typingIndicatorCustomView to typingIndicatorProxyView
1 parent ae86318 commit 5c49393

File tree

3 files changed

+18
-14
lines changed

3 files changed

+18
-14
lines changed

Examples/Messenger-Shared/MessageViewController.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ - (void)simulateUserTyping:(id)sender
162162
if ([self canShowTypingIndicator]) {
163163

164164
#if DEBUG_CUSTOM_TYPING_INDICATOR
165-
__block TypingIndicatorView *view = (TypingIndicatorView *)self.typingIndicatorCustomView;
165+
__block TypingIndicatorView *view = (TypingIndicatorView *)self.typingIndicatorProxyView;
166166

167167
CGFloat scale = [UIScreen mainScreen].scale;
168168
CGSize imgSize = CGSizeMake(kTypingIndicatorViewAvatarHeight*scale, kTypingIndicatorViewAvatarHeight*scale);

Source/Classes/SLKTextViewController.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@ NS_CLASS_AVAILABLE_IOS(7_0) @interface SLKTextViewController : UIViewController
6262
/** The typing indicator used to display user names horizontally. */
6363
@property (nonatomic, readonly) SLKTypingIndicatorView *typingIndicatorView;
6464

65-
/** The custom typing indicator view. Will be a kind of SLKTypingIndicatorView by default. Override by calling -registerClassForTypingIndicatorView: during init */
66-
@property (nonatomic, readonly) UIView <SLKTypingIndicatorProtocol> *typingIndicatorCustomView;
65+
/**
66+
The custom typing indicator view. Default is kind of SLKTypingIndicatorView.
67+
To customize the typing indicator view, you will need to call -registerClassForTypingIndicatorView: nside of any initialization method.
68+
To interact with it directly, you will need to cast the return value of -typingIndicatorProxyView to the appropriate type.
69+
*/
70+
@property (nonatomic, readonly) UIView <SLKTypingIndicatorProtocol> *typingIndicatorProxyView;
6771

6872
/** A single tap gesture used to dismiss the keyboard. */
6973
@property (nonatomic, readonly) UIGestureRecognizer *singleTapGesture;

Source/Classes/SLKTextViewController.m

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ @implementation SLKTextViewController
7676
@synthesize tableView = _tableView;
7777
@synthesize collectionView = _collectionView;
7878
@synthesize scrollView = _scrollView;
79-
@synthesize typingIndicatorCustomView = _typingIndicatorCustomView;
79+
@synthesize typingIndicatorProxyView = _typingIndicatorProxyView;
8080
@synthesize textInputbar = _textInputbar;
8181
@synthesize autoCompletionView = _autoCompletionView;
8282
@synthesize autoCompleting = _autoCompleting;
@@ -322,24 +322,24 @@ - (SLKTextInputbar *)textInputbar
322322
return _textInputbar;
323323
}
324324

325-
- (UIView <SLKTypingIndicatorProtocol> *)typingIndicatorCustomView
325+
- (UIView <SLKTypingIndicatorProtocol> *)typingIndicatorProxyView
326326
{
327-
if (!_typingIndicatorCustomView)
327+
if (!_typingIndicatorProxyView)
328328
{
329329
Class class = self.typingIndicatorViewClass ? : [SLKTypingIndicatorView class];
330330

331-
_typingIndicatorCustomView = [[class alloc] init];
332-
_typingIndicatorCustomView.translatesAutoresizingMaskIntoConstraints = NO;
333-
_typingIndicatorCustomView.hidden = YES;
331+
_typingIndicatorProxyView = [[class alloc] init];
332+
_typingIndicatorProxyView.translatesAutoresizingMaskIntoConstraints = NO;
333+
_typingIndicatorProxyView.hidden = YES;
334334

335-
[_typingIndicatorCustomView addObserver:self forKeyPath:NSStringFromSelector(@selector(isVisible)) options:NSKeyValueObservingOptionNew context:nil];
335+
[_typingIndicatorProxyView addObserver:self forKeyPath:NSStringFromSelector(@selector(isVisible)) options:NSKeyValueObservingOptionNew context:nil];
336336
}
337-
return _typingIndicatorCustomView;
337+
return _typingIndicatorProxyView;
338338
}
339339

340340
- (SLKTypingIndicatorView *)typingIndicatorView
341341
{
342-
return (SLKTypingIndicatorView *)self.typingIndicatorCustomView;
342+
return (SLKTypingIndicatorView *)self.typingIndicatorProxyView;
343343
}
344344

345345
- (BOOL)isExternalKeyboardDetected
@@ -1967,8 +1967,8 @@ - (void)dealloc
19671967
_textInputbar = nil;
19681968
_textViewClass = nil;
19691969

1970-
[_typingIndicatorCustomView removeObserver:self forKeyPath:NSStringFromSelector(@selector(isVisible))];
1971-
_typingIndicatorCustomView = nil;
1970+
[_typingIndicatorProxyView removeObserver:self forKeyPath:NSStringFromSelector(@selector(isVisible))];
1971+
_typingIndicatorProxyView = nil;
19721972
_typingIndicatorViewClass = nil;
19731973

19741974
_registeredPrefixes = nil;

0 commit comments

Comments
 (0)