diff options
author | Joel Fischer <joeljfischer@gmail.com> | 2021-11-16 15:04:49 -0500 |
---|---|---|
committer | Joel Fischer <joeljfischer@gmail.com> | 2021-11-16 15:04:49 -0500 |
commit | 7fb64b9ab7ed3da9fff980bc11e9882cd9c8d188 (patch) | |
tree | 209682626c0326e922a14e92c0f3c77cc5b12af3 | |
parent | 08b8d47eb692b1b6b6776dca018c1f57822a65e1 (diff) | |
download | sdl_ios-bugfix/issue-2064-incorrect-keyboard-response.tar.gz |
Fix multiple observations of keyboard notificationbugfix/issue-2064-incorrect-keyboard-response
-rw-r--r-- | SmartDeviceLink/private/SDLPreloadPresentChoicesOperation.m | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/SmartDeviceLink/private/SDLPreloadPresentChoicesOperation.m b/SmartDeviceLink/private/SDLPreloadPresentChoicesOperation.m index da079dcd3..692013e08 100644 --- a/SmartDeviceLink/private/SDLPreloadPresentChoicesOperation.m +++ b/SmartDeviceLink/private/SDLPreloadPresentChoicesOperation.m @@ -162,6 +162,8 @@ typedef NS_ENUM(NSUInteger, SDLPreloadPresentChoicesOperationState) { [super start]; if (self.isCancelled) { return; } + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_keyboardInputNotification:) name:SDLDidReceiveKeyboardInputNotification object:nil]; + // If we have no loaded cells, reset choice ids to ensure reconnections restart numbering if (self.loadedCells.count == 0) { SDLPreloadPresentChoicesOperationUtilities.choiceId = 0; @@ -311,8 +313,6 @@ typedef NS_ENUM(NSUInteger, SDLPreloadPresentChoicesOperationState) { self.currentState = SDLPreloadPresentChoicesOperationStateUpdatingKeyboardProperties; if (self.keyboardDelegate == nil) { return completionHandler(nil); } - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(sdl_keyboardInputNotification:) name:SDLDidReceiveKeyboardInputNotification object:nil]; - // Check if we're using a keyboard (searchable) choice set and setup keyboard properties if we need to if (self.keyboardDelegate != nil && [self.keyboardDelegate respondsToSelector:@selector(customKeyboardConfiguration)]) { SDLKeyboardProperties *customProperties = self.keyboardDelegate.customKeyboardConfiguration; |