3

I have a custom interactive transition which requires me to hide the standard back button. Basically, the transition looks like a push from left-to-right rather than the standard right-to-left push we're all familiar with. That's why my back button is on the right side instead.

As you can see from two screenshots I took before and after cancelling pop transition activated by a UIScreenEdgePanGestureRecognizer, once the transition is cancelled there is a "..." where the back button would be.

Before and After Cancelling the transition

I'm currently using

self.navigationItem.hidesBackButton = YES;

and I've tried putting it in awakeFromNib, viewDidLoad, viewDidAppear, viewWillAppear methods all without fixing the problem.

So using the power of Reveal.app I investigated the view hierarchy before and after and saw this:

View hierarchy before and after via reveal.app

What you see highlighted in each part of the image is what appears to be changing in the area of the nav bar that contains the hidden back button. Before it's a UINavigationButton and then it becomes a UINavigationButtonItem with a UILabel, which must be what contains the "..." and remains like this.

Any help would be much appreciated. I hope this is detailed enough to give a good picture of the issue.

bitwit
  • 2,589
  • 2
  • 28
  • 33
  • 1
    Can you do a full view hierarchy dump from the debugger with `po [self.view recursiveDescription]`? – Jason Moore Nov 08 '13 at 17:20
  • 1
    Also, I wonder if the '...' isn't just a truncation of a longer string assigned to the `UILabel`. Find the address of the UILabel (from that recursive description) and do: `po [(UILabel*)0xfoofoo text]` – Jason Moore Nov 08 '13 at 17:27
  • I was thinking the same thing re: "..." just being a cut off string. I'll try printing it out. It's possibly the word "Back" – bitwit Nov 08 '13 at 17:39
  • @JasonMoore So it looks like from the printout the UILabel contains the title of the view I'm popping back to. So I tried removing the title in my storyboard and still had the "..." issues because the UILabel now became "Back" instead. So this appears to be some issue with the back button image hiding but it's label not – bitwit Nov 08 '13 at 17:59

1 Answers1

2

Try creating an empty backbutton first (in the parent viewcontroller before the vc is pushed) - maybe that will prevent the "..." UILabel from being created.

self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStyleBordered target:nil action:nil];

Another idea: Just set the parent vc title to an empty string.

self.title = @"";

Jason Moore
  • 7,169
  • 1
  • 44
  • 45
  • I added self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStyleBordered target:nil action:nil]; in my **prepareForSegue:** call in the parentVC and the problem appears to be gone :) – bitwit Nov 08 '13 at 19:16
  • 1
    I'm not using Storyboards, but I was able to set `.backBarButtonItem = nil` in viewDidLoad and it doesn't seem to reappear. (If that didn't work, I'd use `viewWillDisappear`. – zekel Jan 20 '14 at 21:17