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

Update views on rotation #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

tovkal
Copy link

@tovkal tovkal commented Jun 25, 2017

Instead of calling setupViews on draw:rect, calling it in layoutSubviews: where the new frame is already set, so scale can be recalculated with the new width.

The only problem I see (specially when enabling Slow animations on the simulator) is that setupViews ends before the rotation animation starts, so you can see the labels with the new sizes before the views rotate. I tried wrapping setupViews inside an animation block without effect.

draw:rect will be called by UIKit on rotation when setting view.contentMode = UIViewContentModeRedraw (default value is scaleToFill), but I've read that implementing draw:rect reduces performance because a graphic context is created to be used in the method.

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

Successfully merging this pull request may close these issues.

1 participant