Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fix: If there's only one image, avoid dragging the image to get back …
…to 1X when enlarge it to preview on iOS devices
  • Loading branch information
janlionly committed May 27, 2021
commit 56ebb45461e8bd177151a988bb7403255f215af4
3 changes: 0 additions & 3 deletions BFRImageViewController/BFRImageContainerViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions BFRImageViewController/BFRImageContainerViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
1 change: 0 additions & 1 deletion BFRImageViewController/BFRImageViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down