@@ -1185,16 +1185,6 @@ - (void)didPressArrowKey:(id)sender
1185
1185
1186
1186
#pragma mark - Notification Events
1187
1187
1188
- - (void )observeValueForKeyPath : (NSString *)keyPath ofObject : (id )object change : (NSDictionary *)change context : (void *)context
1189
- {
1190
- if ([object conformsToProtocol: @protocol (SLKTypingIndicatorProtocol)] && [keyPath isEqualToString: @" visible" ]) {
1191
- [self slk_willShowOrHideTypeIndicatorView: object];
1192
- }
1193
- else {
1194
- [super observeValueForKeyPath: keyPath ofObject: object change: change context: context];
1195
- }
1196
- }
1197
-
1198
1188
- (void )slk_willShowOrHideKeyboard : (NSNotification *)notification
1199
1189
{
1200
1190
// Skips if the view isn't visible.
@@ -1385,7 +1375,7 @@ - (void)slk_didShakeTextView:(NSNotification *)notification
1385
1375
- (void )slk_willShowOrHideTypeIndicatorView : (UIView <SLKTypingIndicatorProtocol> *)typingIndicatorView
1386
1376
{
1387
1377
// Skips if the typing indicator should not show. Ignores the checking if it's trying to hide.
1388
- if (![self canShowTypingIndicator ] && ![ typingIndicatorView isVisible ] ) {
1378
+ if (![self canShowTypingIndicator ] && typingIndicatorView. isVisible ) {
1389
1379
return ;
1390
1380
}
1391
1381
@@ -1416,6 +1406,19 @@ - (void)slk_willTerminateApplication:(NSNotification *)notification
1416
1406
}
1417
1407
1418
1408
1409
+ #pragma mark - KVO Events
1410
+
1411
+ - (void )observeValueForKeyPath : (NSString *)keyPath ofObject : (id )object change : (NSDictionary *)change context : (void *)context
1412
+ {
1413
+ if ([object conformsToProtocol: @protocol (SLKTypingIndicatorProtocol)] && [keyPath isEqualToString: @" visible" ]) {
1414
+ [self slk_willShowOrHideTypeIndicatorView: object];
1415
+ }
1416
+ else {
1417
+ [super observeValueForKeyPath: keyPath ofObject: object change: change context: context];
1418
+ }
1419
+ }
1420
+
1421
+
1419
1422
#pragma mark - Auto-Completion Text Processing
1420
1423
1421
1424
- (void )registerPrefixesForAutoCompletion : (NSArray *)prefixes
@@ -1941,7 +1944,6 @@ - (void)slk_registerNotifications
1941
1944
[[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (slk_didPostSLKKeyboardNotification: ) name: SLKKeyboardWillHideNotification object: nil ];
1942
1945
[[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (slk_didPostSLKKeyboardNotification: ) name: SLKKeyboardDidHideNotification object: nil ];
1943
1946
#endif
1944
-
1945
1947
1946
1948
// TextView notifications
1947
1949
[[NSNotificationCenter defaultCenter ] addObserver: self selector: @selector (slk_willChangeTextViewText: ) name: SLKTextViewTextWillChangeNotification object: nil ];
0 commit comments