diff --git a/BFRImageViewController/BFRImageContainerViewController.h b/BFRImageViewController/BFRImageContainerViewController.h index 9056925..4763d0c 100644 --- a/BFRImageViewController/BFRImageContainerViewController.h +++ b/BFRImageViewController/BFRImageContainerViewController.h @@ -37,9 +37,6 @@ typedef NS_ENUM(NSUInteger, BFRImageAssetType) { /*! Assigning YES to this property will disable long pressing media to present the activity view controller. You typically don't set this property yourself, instead, the value is derived from the containing @c BFRImageViewController instance. */ @property (nonatomic, getter=shouldDisableSharingLongPress) BOOL disableSharingLongPress; -/*! If there is more than one image in the containing @c BFRImageViewController - this property is set to YES to make swiping from image to image easier. */ -@property (nonatomic, getter=shouldDisableHorizontalDrag) BOOL disableHorizontalDrag; - /*! Assigning YES to this property will disable autoplay for live photos when it used with 3DTouch peek feature */ @property (nonatomic, getter=shouldDisableAutoplayForLivePhoto) BOOL disableAutoplayForLivePhoto; @property (nonatomic, assign) CGFloat imageMaxScale; diff --git a/BFRImageViewController/BFRImageContainerViewController.m b/BFRImageViewController/BFRImageContainerViewController.m index dd50b9c..4ff550d 100644 --- a/BFRImageViewController/BFRImageContainerViewController.m +++ b/BFRImageViewController/BFRImageContainerViewController.m @@ -224,9 +224,8 @@ - (void)createActiveAssetView { // Dragging to dismiss UIPanGestureRecognizer *panImg = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handleDrag:)]; - if (self.shouldDisableHorizontalDrag) { - panImg.delegate = self; - } + panImg.delegate = self; + [resizableImageView addGestureRecognizer:panImg]; if (self.assetType == BFRImageAssetTypeLivePhoto) { @@ -266,6 +265,9 @@ - (void)handleHiResImageDownloaded:(NSNotification *)note { // If we have more than one image, this will cancel out dragging horizontally to make it easy to navigate between images - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { CGPoint velocity = [(UIPanGestureRecognizer *)gestureRecognizer velocityInView:self.scrollView]; + if (self.scrollView.zoomScale > 1) { + return NO; + } return fabs(velocity.y) > fabs(velocity.x); } @@ -370,7 +372,6 @@ - (void)handleDrag:(UIPanGestureRecognizer *)recognizer { [self.animator removeAllBehaviors]; self.activeAssetView.userInteractionEnabled = NO; self.scrollView.userInteractionEnabled = NO; - UIGravityBehavior *exitGravity = [[UIGravityBehavior alloc] initWithItems:@[self.activeAssetView]]; if (CGRectContainsPoint(closeTopThreshhold, location)) { exitGravity.gravityDirection = CGVectorMake(0.0, -1.0); diff --git a/BFRImageViewController/BFRImageViewController.m b/BFRImageViewController/BFRImageViewController.m index 708a5c1..1900dfd 100644 --- a/BFRImageViewController/BFRImageViewController.m +++ b/BFRImageViewController/BFRImageViewController.m @@ -184,7 +184,6 @@ - (void)reinitializeUI { imgVC.usedFor3DTouch = self.isBeingUsedFor3DTouch; imgVC.useTransparentBackground = self.isUsingTransparentBackground; imgVC.disableSharingLongPress = self.shouldDisableSharingLongPress; - imgVC.disableHorizontalDrag = (self.images.count > 1); imgVC.disableAutoplayForLivePhoto = self.shouldDisableAutoplayForLivePhoto; imgVC.imageMaxScale = self.maxScale; [self.imageViewControllers addObject:imgVC];