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

Using CLImageViewPopoup in a table view #5

Open
Pe-te opened this issue Jul 18, 2017 · 1 comment
Open

Using CLImageViewPopoup in a table view #5

Pe-te opened this issue Jul 18, 2017 · 1 comment

Comments

@Pe-te
Copy link

Pe-te commented Jul 18, 2017

Hi, we have the imageview in a cell in a tableview and sometimes get a weird effect, where the image comes flying in from the bottom instead of just starting where the image was clicked.

Think this line is causing the problem:

    let point = self.convert(self.bounds, to: parentView)
  • GOOD: When the list is at the beginning, the convert works fine:
    self.bounds = (0.0, 0.0, 280.0, 200.0)
    point = (20.0, 59.0, 280.0, 200.0)
  • BAD: When you scroll down the list and then pick an item, the y coordinate is wrong (this should also give y around 59 instead of 2570):
    self.bounds = (0.0, 0.0, 280.0, 200.0)
    point = (20.0, 2570.0, 280.0, 200.0)

Not sure how to fix it properly, maybe check if it is inside a scrollview or there could be a different convert function for that?

@Pe-te
Copy link
Author

Pe-te commented Jul 19, 2017

Hi, this works for me, any drawbacks?

            let point = self.convert(self.bounds, to: UIApplication.shared.keyWindow)

It would also remove calculation of parentView and findParentViewController().

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

1 participant