title: UINavigationController: Apply Common Padding/Margin to all Popped View Controller's Views
body: <p>I have a <code>UINavigationController</code> and I would like the view of every view controller that is popped onto the stack to have a common padding/margin (e.g. 25 pixels on all sides). What is the best way to accomplish this?</p>
  
  <p>I originally thought that I could implement <code>UINavigationControllerDelegate</code> and inside the <code>navigationController:didShowViewController:animated</code> or <code>navigationController:willShowViewController:animated</code> methods, simply change the frame of the view controller that was about to be displayed. This does not seem to have an effect though. </p>
  
  <p>I tried to do the same thing inside the view controller's <code>viewDidAppear</code> and <code>viewWillAppear</code> methods, but this also did not work. Ideally, I don't want to put any logic in the controllers anyway, as they may not always be used inside a navigation controller.</p>
  
  <p>One last idea that I haven't tried yet is to create a "wrapper" <code>UIViewController</code> that would actually get pushed onto this stack. This wrapper would add the real view controller's view as a subview with a frame that would provide the desired margin. The downside here is that I would need to subclass <code>UINavigationController</code> and override <code>pushViewController:animated</code>, where the wrapper would be initialized and pushed. Apple's documentation indicates that <code>UINavigationController</code> is not meant to be subclassed.</p>
  
  <p>Thanks in advance.</p>