title: Original back button in iOS navigation bar shows briefly after replacing it with a custom one
body: <p>Before I begin, I just want to give some background info. I have implemented a custom back button before, in an iOS app of mine. Back then, I got it working in minutes, so it was a really nice experience.</p>
  
  <p>This this time, however, I faced strange problems. First, the custom back button did not show at all. Then, I got it to overlap the original back button. I could, however, never remove the original back button.</p>
  
  <p>I was at a loss until I found the answer here: <a href="http://smartercoder.com/2010/10/18/what-to-do-it-self-navigationitem-hidesbackbutton-true-doesnt-work" rel="nofollow">http://smartercoder.com/2010/10/18/what-to-do-it-self-navigationitem-hidesbackbutton-true-doesnt-work</a>. The solution was to set a dummy left button and remove it, before telling the navigation item to hide the back button and add the custom button.</p>
  
  <p>However, although the custom button now replaces the original one, the result is not as nice as in my first app. I still see the original back button briefly, during the push transition. Clearly, it would be better if it did not to show up at all.</p>
  
  <p>This is the code that I run in <strong>viewDidLoad</strong>:</p>
  
  <pre><code>self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:[[UIView alloc] init]];
  self.navigationItem.leftBarButtonItem = nil;
  self.navigationItem.hidesBackButton = YES;
  self.navigationItem.leftBarButtonItem = [UIBarButtonItem barButtonItemWithImage:[UIImage imageNamed:@"toolbar-button-back"] andAction:@selector(triggerBackNavigation:) withTarget:self];
  </code></pre>
  
  <p>If anyone knows how to entirely remove the original back button during the push transitions (both forward and backwards) as well, I would love to hear it.</p>