When the user rotates the device, I need to reposition my view.
I do this in viewDidLayoutSubview(). iOS then smoothly rotates
the view to the new position.

However, in order to reposition my view in viewDidLayoutSubview()
I need to know whether viewDidLayoutSubview() is called because
the user has rotated the device or not.

Thus, I set a flag in viewWillTransitionToSize() that tells
viewDidLayoutSubview() that a rotation is currently in progress.
This flag is then reset in viewDidLayoutSubview() after it has
repositioned the view. This works fine but still I feel somewhat
uneasy about this because I'm not sure whether this is really the
best way to do this. I'm also worried about potential unwanted
side effects.

That's why I wanted to ask what is the recommended way to
reposition my view when the user rotates the device?

I've already done a lot of research on this but I'm still not
confident about this. Note that I'm not using Interface Builder
or anything. My app just consists of a single UIView which is
created manually. The UIView is custom-drawn by setting its
CALayer to a CGImageRef.

-- 
Best regards,
 Andreas Falkenhahn                          mailto:andr...@falkenhahn.com

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to