Add accessibility identifiers to privacy popups and subviews.

pull/2/head
Matthew Chen 7 years ago
parent cb5ce42e76
commit 1a80f0c293

@ -349,10 +349,12 @@ NSString *const kProfileView_LastPresentedDate = @"kProfileView_LastPresentedDat
case ProfileViewMode_AppSettings: case ProfileViewMode_AppSettings:
if (self.hasUnsavedChanges) { if (self.hasUnsavedChanges) {
// If we have a unsaved changes, right item should be a "save" button. // If we have a unsaved changes, right item should be a "save" button.
self.navigationItem.rightBarButtonItem = UIBarButtonItem *saveButton =
[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemSave
target:self target:self
action:@selector(updatePressed)]; action:@selector(updatePressed)];
SET_SUBVIEW_ACCESSIBILITY_IDENTIFIER(self, saveButton);
self.navigationItem.rightBarButtonItem = saveButton;
} else { } else {
self.navigationItem.rightBarButtonItem = nil; self.navigationItem.rightBarButtonItem = nil;
} }

@ -21,7 +21,10 @@ import Foundation
settingsAction.accessibilityIdentifier = "OWSAlerts.\("settings")" settingsAction.accessibilityIdentifier = "OWSAlerts.\("settings")"
alertController.addAction(settingsAction) alertController.addAction(settingsAction)
} }
CurrentAppContext().frontmostViewController()?.present(alertController, animated: true, completion: nil) CurrentAppContext().frontmostViewController()?.present(alertController, animated: true,
completion: {
alertController.applyAccessibilityIdentifiers()
})
} }
@objc @objc
@ -30,7 +33,10 @@ import Foundation
owsFailDebug("frontmostViewController was unexpectedly nil") owsFailDebug("frontmostViewController was unexpectedly nil")
return return
} }
frontmostViewController.present(alert, animated: true, completion: nil) frontmostViewController.present(alert, animated: true,
completion: {
alert.applyAccessibilityIdentifiers()
})
} }
@objc @objc
@ -61,7 +67,10 @@ import Foundation
let okAction = UIAlertAction(title: actionTitle, style: .default, handler: buttonAction) let okAction = UIAlertAction(title: actionTitle, style: .default, handler: buttonAction)
okAction.accessibilityIdentifier = "OWSAlerts.\("ok")" okAction.accessibilityIdentifier = "OWSAlerts.\("ok")"
alert.addAction(okAction) alert.addAction(okAction)
fromViewController?.present(alert, animated: true, completion: nil) fromViewController?.present(alert, animated: true,
completion: {
alert.applyAccessibilityIdentifiers()
})
} }
@objc @objc
@ -76,7 +85,10 @@ import Foundation
okAction.accessibilityIdentifier = "OWSAlerts.\("ok")" okAction.accessibilityIdentifier = "OWSAlerts.\("ok")"
alert.addAction(okAction) alert.addAction(okAction)
CurrentAppContext().frontmostViewController()?.present(alert, animated: true, completion: nil) CurrentAppContext().frontmostViewController()?.present(alert, animated: true,
completion: {
alert.applyAccessibilityIdentifiers()
})
} }
@objc @objc

Loading…
Cancel
Save