Skip to content

Commit 28bb678

Browse files
committed
improve accessibility in WPImageViewController.m
1 parent 98f029e commit 28bb678

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

WordPress/Classes/ViewRelated/Reader/WPImageViewController.m

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ - (void)updateImageView
246246
[self.imageView sizeToFit];
247247
self.scrollView.contentSize = self.imageView.image.size;
248248
[self centerImage];
249+
249250
}
250251

251252
- (void)loadImageFromURL
@@ -568,6 +569,14 @@ - (void)setupAccessibility
568569
{
569570
self.imageView.isAccessibilityElement = YES;
570571
self.imageView.accessibilityTraits = UIAccessibilityTraitImage;
572+
573+
if (self.media != nil && self.media.title != nil) {
574+
self.imageView.accessibilityLabel = [NSString stringWithFormat:NSLocalizedString(@"Fullscreen view of image %@. Double tap to dismiss the screen", @"Accessibility label for when image is shown to user in full screen, with instructions on how to dismiss the screen. Paramater is the title of the image"), self.media.title];
575+
}
576+
else {
577+
self.imageView.accessibilityLabel = NSLocalizedString(@"Fullscreen view of image. Double tap to dismiss the screen", @"Accessibility label for when image is shown to user in full screen, with instructions on how to dismiss the screen");
578+
}
579+
571580
}
572581

573582
- (BOOL)accessibilityPerformEscape

0 commit comments

Comments
 (0)