Add accessibility identifiers to privacy popups and subviews.

This commit is contained in:
Matthew Chen 2019-03-21 10:01:40 -04:00
parent cb5ce42e76
commit 1a80f0c293
2 changed files with 19 additions and 5 deletions

View file

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

View file

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