8

There is some change done in viewdidlayoutsubviews in iOS 13 that is causing it to be called later in the life cycle of the View Controller once it has finished its first callings (on changing frame). This is creating some weird effects in the apps.

What I have observed is that before iOS13 changing frames do not call viewdidlayoutsubviews while in new iOS 13 it gets called.

Is this some kind of new feature by Apple or some bug? Any suggestions on how to stop this behavior?

Hassy
  • 3,622
  • 3
  • 29
  • 54

1 Answers1

1

I'm facing that issue only for an UIViewController which will be added as a child of a Container View Controller. The device was not rotated - these are just the methods which will be called if the UIViewController was initial added to the hierarchy:

iOS 12:

  1. viewDidLayoutSubviews
  2. viewDidAppear

iOS 13:

  1. viewDidAppear
  2. viewDidLayoutSubviews

For me, that's not a feature hence it does not make sense calling viewDidLayoutSubviews after viewDidAppear (if the device was not rotated). Looks like a bug on iOS 13.

charlyatwork
  • 1,036
  • 8
  • 12
  • I'm having an issue because of this too. I think it's some sort of bug however, since the iOS13 order (viewDidAppear then viewDidLayoutSubviews) only happens the first time the ViewController is instantiated. I'm in a NavigationController scenario, and if I go back to the calling view controller, then forward to my problematic VC a second time (and all subsequent times), the order is back to the iOS 12 version of viewDidLayoutSubviews, then viewDidAppear. – SuperDuperTango Jan 17 '20 at 21:46