Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Smart Invert mode in iOS11 #270

Merged
merged 2 commits into from
Mar 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Classes/IDMPhotoBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
5 changes: 5 additions & 0 deletions Classes/IDMZoomingScrollView.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down