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

Auto Layout and transforms #107

Closed
noordawod opened this issue Aug 28, 2017 · 4 comments
Closed

Auto Layout and transforms #107

noordawod opened this issue Aug 28, 2017 · 4 comments

Comments

@noordawod
Copy link

Hi again,

I'm facing an issue with this library that isn't apparent in others. Sadly, this means I cannot use this lightweight and excellent library and must jump ship.

The problem lies in Auto Layout's erratic behaviour when using view transforms, which this library makes use of. In the examples you provide this is not apparent because you don't actually put anything in the cards -- just a background color. But the minute you put an image view, a label, and few other views that use Auto Layout, you're going to start seeing some wrong behaviour when the card rotates. Go ahead and try it out.

Here's a couple of links to give you a background about this "problem":

https://stackoverflow.com/a/14105757/4202478
https://revealapp.com/blog/constraints-and-transforms.html

So, there are 2 solutions:

  1. Provide an example where a card (say, as XIB) includes subviews which use Auto Layout play well with the library.
  2. Patch the existing code to make sure that inserted cards are automatically adjusted to work with view transforms. Possibly removing and adding constraints. The first link above gives a hint (note no.2).

Would love to see this fixed during the week, it means I can continue to use it. And thank you in advance!

@AndrewSB
Copy link
Collaborator

Hey @noordawod, thank you for the detailed write up 😄
Yup, this has been a problem for a while, and confused me too when I first found this library. The issue was tracked in zhxnlai/ZLSwipeableView#9, which is linked in the README, but isn't the most visible :/

Do you have any ideas on how to make the solution easier to find - either through code or documentation? I think it would be awesome to help new users and not have them go down the same hole you've found yourself in!

@noordawod
Copy link
Author

Well, although I managed to fix it in my code earlier (without knowing about issue #9), I don't like hackish solutions. And my code (and the one in the earlier issue) is hackish. It might break in a next iOS release, so I don't want to take this chance.

Also, that post is from 2014 and it seems the maintainers don't have time to address this for three years... So due to that, I decided to use another piece of code that's still maintained.

@bhavin-a
Copy link

bhavin-a commented Sep 4, 2017

Hey noordawod
Can you please share how did correct it? It would be of great help.

Thanks in advance

@noordawod
Copy link
Author

I didn't. I switched to another library.

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

3 participants