From 189bbb9f1699d93b9e2d42296d8da9a3ad9c18df Mon Sep 17 00:00:00 2001 From: Nancy Mast Date: Thu, 7 Feb 2019 15:18:29 -0800 Subject: [PATCH] added accessibility ids to HomeViewController and ProfileViewController --- Signal/src/ViewControllers/HomeView/HomeViewController.m | 8 +++++++- Signal/src/ViewControllers/ProfileViewController.m | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index 4ebfde9c9..b6c631676 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -340,7 +340,6 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) { [self.view addSubview:self.emptyInboxView]; [self.emptyInboxView autoPinWidthToSuperviewMargins]; [self.emptyInboxView autoVCenterInSuperview]; - SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _emptyInboxView); [self createFirstConversationCueView]; [self.view addSubview:self.firstConversationCueView]; @@ -361,6 +360,13 @@ typedef NS_ENUM(NSInteger, HomeViewControllerSection) { action:@selector(pullToRefreshPerformed:) forControlEvents:UIControlEventValueChanged]; [self.tableView insertSubview:pullToRefreshView atIndex:0]; + + SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _tableView); + SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _emptyInboxView); + SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _firstConversationCueView); + SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _firstConversationLabel); + SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _searchBar); + SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, _reminderStackView); } - (UIView *)createEmptyInboxView diff --git a/Signal/src/ViewControllers/ProfileViewController.m b/Signal/src/ViewControllers/ProfileViewController.m index 96417a830..f71e9f38f 100644 --- a/Signal/src/ViewControllers/ProfileViewController.m +++ b/Signal/src/ViewControllers/ProfileViewController.m @@ -15,13 +15,18 @@ #import #import #import +#import #import #import #import -#import NS_ASSUME_NONNULL_BEGIN +#define SUBVIEW_ACCESSIBILITY_IDENTIFIER(_root_view, _variable_name) \ + ([NSString stringWithFormat:@"%@.%@", _root_view.class, _variable_name]) +#define SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(_root_view, _variable_name) \ + _variable_name.accessibilityIdentifier = SUBVIEW_ACCESSIBILITY_IDENTIFIER(_root_view, (@ #_variable_name)) + typedef NS_ENUM(NSInteger, ProfileViewMode) { ProfileViewMode_AppSettings = 0, ProfileViewMode_Registration,