On 28.11.2016 at 16:50 David Duncan wrote: > I think you can do everything you need to do in layoutSubviews > (fundamentally it doesn’t matter if the device rotates or not, you > just want to keep the view centered in its superview).
Right, makes sense. > In general you should do as much as possible in layoutSubviews type > methods. However sometimes you really do want to do something > temporary specifically due to a transition between sizes, > orientations, or size classes, and hence why we provide the > “willTransitionTo” methods. If it isn’t a temporary change, then you > don’t want the transition methods, as they are not always called at > points when layoutSubviews will be. Ok, I've now ditched "willTransitionTo" completely and everything is done in my UIView's layoutSubviews method now. Seems to work fine. Just one last thing: the documentation of layoutSubviews mentions that this method, as its name implies, is meant to make adjustments to subviews. But my UIView doesn't have any subviews at all. So currently I'm basically (ab?)using layoutSubviews to make adjustments to the UIView itself, not to its subviews, since there are none. Is that allowed? -- 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