Skip to content

Commit

Permalink
Merge pull request #270 from arnoldxt/master
Browse files Browse the repository at this point in the history
Support Smart Invert mode in iOS11
  • Loading branch information
thiagoperes authored Mar 5, 2018
2 parents c677bc8 + c57ca85 commit 01fbba9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Classes/IDMPhotoBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,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 @@ -437,6 +442,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];

//Add darg&drop in iOS 11
Expand Down

0 comments on commit 01fbba9

Please sign in to comment.