Storyboard Change

This Storyboard change bit me this morning. I was trying to do some initial calculations from my view geometry before it is displayed at app launch. Previously, when using XIB files to define an interface, you would be able to see your view geometry as early as viewWillAppear: in your UIViewController.

With Storyboards, view geometry will not be ready until later. In my case, within viewWillAppear: the view bounds returned all zeros. Took a bit of Googling to find the answer, but eventually came across this question at StackOverflow:

Gettting [sp] subViews’ frames in Storyboard

In short, if you need your view geometry as early as possible, use viewDidLayoutSubviews in your UIViewController.