2727@interface ViewController () {
2828 id <ACRIBaseActionSetRenderer> _defaultRenderer;
2929 ACRChatWindow *_dataSource;
30+ __weak UIView *_targetView;
3031 dispatch_queue_t _global_queue;
3132 __weak AVPlayerViewController *_mediaViewController;
3233}
@@ -212,7 +213,6 @@ - (void)viewDidLoad
212213
213214 ACOFeatureRegistration *featureReg = [ACOFeatureRegistration getInstance ];
214215 [featureReg addFeature: @" acTest" featureVersion: @" 1.0" ];
215-
216216 [NSNotificationCenter .defaultCenter addObserver: self selector: @selector (handleVoiceOverEvent: ) name: UIAccessibilityElementFocusedNotification object: nil ];
217217}
218218
@@ -281,7 +281,7 @@ - (void)didFetchUserResponses:(ACOAdaptiveCard *)card action:(ACOBaseActionEleme
281281 } else if (action.type == ACRToggleVisibility) {
282282 [self reloadRowsAtChatWindowsWithIndexPaths: self .chatWindow.indexPathsForSelectedRows];
283283 } else if (action.type == ACRShowCard) {
284- [self reloadRowsAtChatWindowsWithIndexPaths: self .chatWindow.indexPathsForSelectedRows];
284+ [self reloadRowsAtChatWindowsWithIndexPaths: self .chatWindow.indexPathsForSelectedRows targetView: _targetView ];
285285 }
286286}
287287
@@ -313,6 +313,7 @@ - (void)didChangeViewLayout:(CGRect)oldFrame newFrame:(CGRect)newFrame propertie
313313
314314- (void )didChangeVisibility : (UIButton *)button isVisible : (BOOL )isVisible
315315{
316+ _targetView = button;
316317 if (isVisible) {
317318 button.backgroundColor = [UIColor redColor ];
318319 } else {
@@ -665,6 +666,11 @@ - (void)reloadRowsAtChatWindowsWithIndexPathsAfterValidation:(NSArray<NSIndexPat
665666}
666667
667668- (void )reloadRowsAtChatWindowsWithIndexPaths : (NSArray <NSIndexPath *> *)indexPaths
669+ {
670+ [self reloadRowsAtChatWindowsWithIndexPaths: indexPaths targetView: nil ];
671+ }
672+
673+ - (void )reloadRowsAtChatWindowsWithIndexPaths : (NSArray <NSIndexPath *> *)indexPaths targetView : (UIView *)targetView
668674{
669675 dispatch_async (_global_queue,
670676 ^{
@@ -687,7 +693,7 @@ - (void)reloadRowsAtChatWindowsWithIndexPaths:(NSArray<NSIndexPath *> *)indexPat
687693 [self .chatWindow reloadData ];
688694 }
689695 completion: ^(BOOL finished) {
690- UIAccessibilityPostNotification (UIAccessibilityLayoutChangedNotification, nil );
696+ UIAccessibilityPostNotification (UIAccessibilityLayoutChangedNotification, targetView );
691697 }];
692698 }
693699 });
0 commit comments