From 6ee97706b3f77fcea4d255dff516a8213643be60 Mon Sep 17 00:00:00 2001 From: Arnold Tang Date: Sun, 24 Sep 2017 23:03:36 +0800 Subject: [PATCH 1/2] Add iOS11 Smart Invert Support --- Classes/IDMPhotoBrowser.m | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Classes/IDMPhotoBrowser.m b/Classes/IDMPhotoBrowser.m index 125785fa..68bf5396 100644 --- a/Classes/IDMPhotoBrowser.m +++ b/Classes/IDMPhotoBrowser.m @@ -375,6 +375,11 @@ - (void)performPresentAnimation { resizableImageView.clipsToBounds = YES; resizableImageView.contentMode = _senderViewForAnimation ? _senderViewForAnimation.contentMode : UIViewContentModeScaleAspectFill; resizableImageView.backgroundColor = [UIColor clearColor]; + if (@available(iOS 11.0, *)) { + resizableImageView.accessibilityIgnoresInvertColors = YES; + } else { + // Fallback on earlier versions + } [_applicationWindow addSubview:resizableImageView]; _senderViewForAnimation.hidden = YES; @@ -432,6 +437,11 @@ - (void)performCloseAnimationWithScrollView:(IDMZoomingScrollView*)scrollView { resizableImageView.contentMode = _senderViewForAnimation ? _senderViewForAnimation.contentMode : UIViewContentModeScaleAspectFill; resizableImageView.backgroundColor = [UIColor clearColor]; resizableImageView.clipsToBounds = YES; + if (@available(iOS 11.0, *)) { + resizableImageView.accessibilityIgnoresInvertColors = YES; + } else { + // Fallback on earlier versions + } [_applicationWindow addSubview:resizableImageView]; self.view.hidden = YES; From c57ca8595548d050f2808ded43b9c72a8579193d Mon Sep 17 00:00:00 2001 From: Arnold Tang Date: Sun, 24 Sep 2017 23:18:38 +0800 Subject: [PATCH 2/2] Add iOS11 Smart Invert Support --- Classes/IDMZoomingScrollView.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Classes/IDMZoomingScrollView.m b/Classes/IDMZoomingScrollView.m index 419ce4fd..974f149f 100644 --- a/Classes/IDMZoomingScrollView.m +++ b/Classes/IDMZoomingScrollView.m @@ -46,6 +46,11 @@ - (id)initWithPhotoBrowser:(IDMPhotoBrowser *)browser { _photoImageView = [[IDMTapDetectingImageView alloc] initWithFrame:CGRectZero]; _photoImageView.tapDelegate = self; _photoImageView.backgroundColor = [UIColor clearColor]; + if (@available(iOS 11.0, *)) { + _photoImageView.accessibilityIgnoresInvertColors = YES; + } else { + // Fallback on earlier versions + } [self addSubview:_photoImageView]; CGRect screenBound = [[UIScreen mainScreen] bounds];