title: UIViewController viewDidLoad incorrect width/height
body: <p>Everybody knows that you can't trust the frame size on a UIViewController init/viewDidLoad method; this:</p>
  
  <pre><code>- (void)viewDidLoad: {
       NSLog(@"%d", self.view.frame.size.width);
  }
  </code></pre>
  
  <p>will print wrong sizes in many occasions (in particular it's pretty much broken in landscape mode)</p>
  
  <p>This will actually return always corrected results so it's good to layout the subviews:</p>
  
  <pre><code>- (void)viewWillAppear: {
       NSLog(@"%d", self.view.frame.size.width);
  }
  </code></pre>
  
  <p>The problem is that viewWillAppears gets called every time the view appears, so it's not suitable to alloc or add subviews. So you end up declaring <b>every single view</b>  in the interface and you end up with huge header files that I don't like at all since most of the items don't need any more manipulations after the initial setup.</p>
  
  <p>So question one is: <b>Is there a better way to handle subviews positioning?</b></p>
  
  <p>Question two is very related, let's say I have a subclass of UIView including various others subviews. I declare it inside my interface, and i alloc/init it in my init/viewDidLoad method.</p>
  
  <pre><code>- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
  {
      ...
      menu = [[SNKSlidingMenu alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
      ...
  }
  </code></pre>
  
  <p>As we already know we now need to reposition it in viewWillAppear to get a more accurate reading</p>
  
  <pre><code>- (void)viewWillAppear:(BOOL)animated{
      ....
      menu.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
      ....
   }
  </code></pre>
  
  <p>The problem is that of course all the subviews needs to be repositioned as well. This is done by the layoutSubviews function that get called automatically, but we got the same problem: <b>All the subviews need to be declared inside the interface of the SNKSlidingMenu class.. Is there a way around this?</b></p>
  
  <p>Thanks.</p>