Skip to content

Commit f57c610

Browse files
author
ignacio
committed
When not using the default typing indicator view, make sure to return nil for typingIndicatorView property
1 parent 7f5bcab commit f57c610

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Source/Classes/SLKTextViewController.m

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ - (void)viewDidLoad
176176

177177
[self.view addSubview:self.scrollViewProxy];
178178
[self.view addSubview:self.autoCompletionView];
179-
[self.view addSubview:self.typingIndicatorView];
179+
[self.view addSubview:self.typingIndicatorProxyView];
180180
[self.view addSubview:self.textInputbar];
181181

182182
[self slk_setupViewConstraints];
@@ -339,7 +339,10 @@ - (SLKTextInputbar *)textInputbar
339339

340340
- (SLKTypingIndicatorView *)typingIndicatorView
341341
{
342-
return (SLKTypingIndicatorView *)self.typingIndicatorProxyView;
342+
if ([_typingIndicatorProxyView isKindOfClass:[SLKTypingIndicatorView class]]) {
343+
return (SLKTypingIndicatorView *)self.typingIndicatorProxyView;
344+
}
345+
return nil;
343346
}
344347

345348
- (BOOL)isExternalKeyboardDetected
@@ -1796,7 +1799,7 @@ - (void)slk_setupViewConstraints
17961799
{
17971800
NSDictionary *views = @{@"scrollView": self.scrollViewProxy,
17981801
@"autoCompletionView": self.autoCompletionView,
1799-
@"typingIndicatorView": self.typingIndicatorView,
1802+
@"typingIndicatorView": self.typingIndicatorProxyView,
18001803
@"textInputbar": self.textInputbar,
18011804
};
18021805

@@ -1808,7 +1811,7 @@ - (void)slk_setupViewConstraints
18081811

18091812
self.scrollViewHC = [self.view slk_constraintForAttribute:NSLayoutAttributeHeight firstItem:self.scrollViewProxy secondItem:nil];
18101813
self.autoCompletionViewHC = [self.view slk_constraintForAttribute:NSLayoutAttributeHeight firstItem:self.autoCompletionView secondItem:nil];
1811-
self.typingIndicatorViewHC = [self.view slk_constraintForAttribute:NSLayoutAttributeHeight firstItem:self.typingIndicatorView secondItem:nil];
1814+
self.typingIndicatorViewHC = [self.view slk_constraintForAttribute:NSLayoutAttributeHeight firstItem:self.typingIndicatorProxyView secondItem:nil];
18121815
self.textInputbarHC = [self.view slk_constraintForAttribute:NSLayoutAttributeHeight firstItem:self.textInputbar secondItem:nil];
18131816
self.keyboardHC = [self.view slk_constraintForAttribute:NSLayoutAttributeBottom firstItem:self.view secondItem:self.textInputbar];
18141817

0 commit comments

Comments
 (0)