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

Flickering (zoom / dismiss conflict) + make fick to dismiss an option #37

Closed
andrew-frank opened this issue Oct 22, 2014 · 4 comments
Closed

Comments

@andrew-frank
Copy link

On a real device, when I want to zoom the image, it flickers (actually really fast resizes/moves), whenever my zoom gesture is fast. I have to zoom very gently to prevent this. Once I manage to zoom it's ok, this issue appears for zoomLevel == 1 and fast gesture.

On simulator it happens if I firstly drag it with mouse, then press option, to begin zooming, when I firstly click option, than mouse, it's ok. So probably it recognizes the beginning of zooming as dragging.

Here's a gif:

(this is iOS 7.1 with JTS 1.3, although I did notice this issue a month ago, when I firstly tried to use it)
The example works fine, the problem is with presenting it from my tableViewCell.

I tried with different combinations of referenceRect/View and modifying code in library (messing with _flags and zoomLevel), but with no luck.

What I do is add a UITapGestureRecognizer to my UIImageView in a UITableViewCell. In tap handler I present JTS:

//Note: This happens in UITableViewCell subclass

-(void)awakeFromNib
{
self.photoImageView.userInteractionEnabled = YES;
    UITapGestureRecognizer *imageTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTap:)];
    [self.photoImageView addGestureRecognizer:imageTapGesture];
}

-(void)handleTap:(UITapGestureRecognizer *)gesture
{
    CGPoint location = [gesture locationInView:[gesture.view superview]];
    if(!CGRectContainsPoint(self.photoImageView.frame, location))
        return;

    JTSImageInfo *imageInfo = [JTSImageInfo new];
    imageInfo.image = self.photoImageView.image;
    imageInfo.referenceRect = self.photoImageView.frame;
    imageInfo.referenceView = self.parentVC.view;

    JTSImageViewController *imageViewer = [[JTSImageViewController alloc] initWithImageInfo:imageInfo mode:JTSImageViewControllerMode_Image backgroundStyle:JTSImageViewControllerBackgroundStyle_ScaledDimmedBlurred];

    imageViewer.interactionsDelegate = self; //thought I could block flickering this way, but tapping also has been disabled
    imageViewer.dismissalDelegate = self;

    [imageViewer showFromViewController:self.parentVC transition:JTSImageViewControllerTransition_FromOffscreen]; //transition has no impact on this issue
}
@andrew-frank
Copy link
Author

Also it would be nice to add an option to disable flickToDismiss. In my case I don't need it that much, but it's a pain to zoom the image

@andrew-frank
Copy link
Author

thanks for response and closing the issue

@bigbadleroybrown
Copy link

Hey @frandrzej looks like you were doing something similar to what I've got going on. If you have a second I'd love to ask you a quick question about how you implemented this library with UIImageView inside of Tableview cell.

Thanks!

@andrew-frank
Copy link
Author

Hi @bigbadleroybrown. I had no luck here (as of version 1.3), so I ended up using https://github.com/ideaismobile/IDMPhotoBrowser

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants