objective-cios7uikituikit-transitions

iOS7 custom interactive transition, hidden back button reappears as "..." when cancelled


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.


Solution

  • 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 = @"";