From 5f06d57d3bf97550efb071cae9915072c44e0e2c Mon Sep 17 00:00:00 2001 From: Johannes Plunien Date: Tue, 27 Nov 2018 10:25:57 +0100 Subject: [PATCH] Set accessibilityIgnoresInvertColors on image views --- CHANGELOG.md | 1 + Example-Swift/ViewController.swift | 4 ++++ Example/NYTViewController.m | 8 ++++++++ NYTPhotoViewer/NYTPhotoTransitionAnimator.m | 5 +++++ NYTPhotoViewer/NYTScalingImageView.m | 3 +++ 5 files changed, 21 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae2c2fdc..ebf658c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Changes for users of the library currently on `develop`: - Fixed some tests, added tests for NYTPhotoViewerSinglePhotoDataSource - Fixed a strict warning and a subscripting bug in NYTPhotoViewerArrayDataSource.m - Added support for interstitial views +- Set `accessibilityIgnoresInvertColors = true` on image views ## [2.0.0](https://github.com/NYTimes/NYTPhotoViewer/releases/tag/2.0.0) diff --git a/Example-Swift/ViewController.swift b/Example-Swift/ViewController.swift index 9152146f..7772b488 100755 --- a/Example-Swift/ViewController.swift +++ b/Example-Swift/ViewController.swift @@ -32,6 +32,10 @@ final class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() + if #available(iOS 11.0, *) { + imageButton?.accessibilityIgnoresInvertColors = true + } + let buttonImage = UIImage(named: ReferencePhotoName) imageButton?.setBackgroundImage(buttonImage, for: UIControlState()) } diff --git a/Example/NYTViewController.m b/Example/NYTViewController.m index 6a504027..5e9aad25 100644 --- a/Example/NYTViewController.m +++ b/Example/NYTViewController.m @@ -30,6 +30,14 @@ @interface NYTViewController () @implementation NYTViewController +- (void)viewDidLoad { + [super viewDidLoad]; + + if (@available(iOS 11.0, *)) { + self.imageButton.accessibilityIgnoresInvertColors = YES; + } +} + - (IBAction)imageButtonTapped:(id)sender { self.dataSource = [self.class newTimesBuildingDataSource]; diff --git a/NYTPhotoViewer/NYTPhotoTransitionAnimator.m b/NYTPhotoViewer/NYTPhotoTransitionAnimator.m index aa80441d..e1821219 100644 --- a/NYTPhotoViewer/NYTPhotoTransitionAnimator.m +++ b/NYTPhotoViewer/NYTPhotoTransitionAnimator.m @@ -120,6 +120,11 @@ - (void)performZoomingAnimationWithTransitionContext:(id