title: Change color of navigation bar ios6 and ios7
body: <p>I'm in the process of upgrading my app to iOS7. However I want to preserve the iOS6 interface as well. It works well except for the navigation bar(s). In iOS7 they look great (just the default color with the translucent property to YES. In iOS6 the navigation bars are showing as the default blue bars and I want them to be black translucent.</p>
  
  <p>What I do is check the version of the iOS and then perform some code. In the debugger I see they right version in the vComp variable but the color is not changing. Don't mind the redColor property, that's just for the test. In both ways I am presented with the default color.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>- (void) fixNavBarColor:(UINavigationBar*)bar {
      NSArray *vComp = [[UIDevice currentDevice].systemVersion componentsSeparatedByString:@"."];
      if ([[vComp objectAtIndex:0] intValue] &gt;= 7) {
          bar.barTintColor = [UIColor redColor];
          bar.translucent = NO;
      }
      else {
          bar.tintColor = [UIColor redColor];
          bar.opaque = YES;
      }
  }
  </code></pre>
  
  <p>There is no error or warning.
  Any ideas?</p>