title: How do I customize the navigation bar on the iPhone in Xcode ?
body: <p>I have the following code-snippets : </p>
  
  <p>1.) </p>
  
  <pre><code>[[UINavigationBar appearance] setBackgroundImage:myImage forBarMetrics:UIBarMetricsDefault];
  </code></pre>
  
  <p>Where would I put that ? </p>
  
  <p>or 2.) </p>
  
  <pre><code>@implementation UINavigationBar (BackgroundImage)
  //This overridden implementation will patch up the NavBar with a custom Image instead of the title
  - (void)drawRect:(CGRect)rect {
       UIImage *image = [UIImage imageNamed: @"NavigationBar.png"];
       [image drawInRect:CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)];
  }
  @end
  </code></pre>
  
  <p>Where would I put that ? </p>
  
  <p>I have tried adding a navigation bar to my viewcontroller but I don't exactly know where to put these pieces of code. </p>