Re: How to detect rotation in progress in viewDidLayoutSubview

2016-11-30 Thread David Duncan
Create and use a subview. There is no significant cost to an additional content-less view. -- David Duncan @ My iPhone > On Nov 30, 2016, at 9:46 AM, Andreas Falkenhahn > wrote: > >> On 29.11.2016 at 22:28 David Duncan wrote: >> >> Correct, because the owning

Re: How to detect rotation in progress in viewDidLayoutSubview

2016-11-30 Thread Andreas Falkenhahn
On 29.11.2016 at 22:28 David Duncan wrote: > Correct, because the owning UIWindow owns the frame of the view > controller’s view, and may change it at any time. > The simplest way to fix your specific issue is to just set the > contentMode to AspectFit. This will automatically center and scale >

Re: How to detect rotation in progress in viewDidLayoutSubview

2016-11-29 Thread David Duncan
> On Nov 29, 2016, at 2:50 PM, Andreas Falkenhahn > wrote: > > On 29.11.2016 at 17:35 David Duncan wrote: > > >>> On Nov 29, 2016, at 11:30 AM, Andreas Falkenhahn >>> wrote: > >>> On 28.11.2016 at 16:50 David Duncan wrote: > I think

Re: How to detect rotation in progress in viewDidLayoutSubview

2016-11-29 Thread Andreas Falkenhahn
On 29.11.2016 at 17:35 David Duncan wrote: >> On Nov 29, 2016, at 11:30 AM, Andreas Falkenhahn >> wrote: >> 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

Re: How to detect rotation in progress in viewDidLayoutSubview

2016-11-29 Thread David Duncan
> On Nov 29, 2016, at 11:30 AM, Andreas Falkenhahn > wrote: > > 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

Re: How to detect rotation in progress in viewDidLayoutSubview

2016-11-29 Thread Andreas Falkenhahn
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

Re: How to detect rotation in progress in viewDidLayoutSubview

2016-11-28 Thread David Duncan
> On Nov 27, 2016, at 7:25 AM, Andreas Falkenhahn > wrote: > > On 27.11.2016 at 00:04 David Duncan wrote: > >> What are you trying to accomplish? > > I want to keep my UIView centered on the screen so I need to > change its position when the device rotates. I'm

Re: How to detect rotation in progress in viewDidLayoutSubview

2016-11-27 Thread Andreas Falkenhahn
On 27.11.2016 at 00:04 David Duncan wrote: > What are you trying to accomplish? I want to keep my UIView centered on the screen so I need to change its position when the device rotates. I'm currently moving the UIView to the new position using [myView setFrame:...]; in

Re: How to detect rotation in progress in viewDidLayoutSubview

2016-11-26 Thread David Duncan
What are you trying to accomplish? For most developers just looking at the aspect ratio in viewDidLayoutSubviews is sufficient. If you only want to do something for rotating, doing it as an alongside animation in viewWillTransitionToSize is usually what you want. Also from your last thread, if

How to detect rotation in progress in viewDidLayoutSubview

2016-11-26 Thread Andreas Falkenhahn
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