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

Perform layout with bounds and center instead of frame #49

Closed
NickEntin opened this issue Jan 18, 2021 · 0 comments
Closed

Perform layout with bounds and center instead of frame #49

NickEntin opened this issue Jan 18, 2021 · 0 comments
Assignees
Milestone

Comments

@NickEntin
Copy link
Collaborator

Currently we perform layout by setting views' frames. Using frame for layout has some significant disadvantages. You can read about some of the complexity behind frames here. The most notable comes from this warning on the documentation for UIView.frame:

Screen Shot 2021-01-17 at 10 39 36 PM

Instead of using frame to perform layout, we should instead set our views' bounds and center. This should have almost the same behavior as setting the frame, except in cases where the view has a non-identity transform (in which case the frame is undefined anyway). This also matches how Auto Layout behaves around transforms.

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