Skip to content

Commit 9fa2a37

Browse files
committed
Allow UIAlertController to get the position info.
1 parent 6f8e261 commit 9fa2a37

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Source/JTSImageViewController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ extern CGFloat const JTSImageViewController_DefaultBackgroundBlurRadius;
173173
/**
174174
Called when the image viewer detects a long press.
175175
*/
176-
- (void)imageViewerDidLongPress:(JTSImageViewController *)imageViewer;
176+
- (void)imageViewerDidLongPress:(JTSImageViewController *)imageViewer atRect:(CGRect)rect;
177177

178178
/**
179179
Called when the image viewer is deciding whether to respond to user interactions.

Source/JTSImageViewController.m

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,9 @@ - (void)imageLongPressed:(UILongPressGestureRecognizer *)sender {
14921492
}
14931493

14941494
if (self.image && sender.state == UIGestureRecognizerStateBegan) {
1495-
if ([self.interactionsDelegate respondsToSelector:@selector(imageViewerDidLongPress:)]) {
1496-
[self.interactionsDelegate imageViewerDidLongPress:self];
1495+
if ([self.interactionsDelegate respondsToSelector:@selector(imageViewerDidLongPress:atRect:)]) {
1496+
CGPoint location = [sender locationInView:self.imageView];
1497+
[self.interactionsDelegate imageViewerDidLongPress:self atRect:CGRectMake(location.x, location.y, 0.0f, 0.0f)];
14971498
}
14981499

14991500
BOOL allowCopy = NO;

0 commit comments

Comments
 (0)