Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning when going back and a tabbar controller has been pushed #34

Closed
pepejeria opened this issue Nov 7, 2015 · 4 comments
Closed

Comments

@pepejeria
Copy link

The warning is: Unbalanced calls to begin/end appearance transitions for UITabBarController: 0x7fb91bd2a850.

Consider the following scenario in storyboards:

  • Have a navigation controller as the initial view controller wit a UIViewController
  • Add a button to the UIViewController that leads to a UITabbarController

Tap on the button to see the tabbar controller, then long press the back button to see the error above.

I can provide you a zip file if you want with this test case, no code involved, just storyboards.

@marty-suzuki
Copy link
Owner

Hi, @pepejeria
Would you like to give zip file to me?

@pepejeria
Copy link
Author

I emailed you the test case to your gmail that can be see on the main page.

@marty-suzuki
Copy link
Owner

Thanks for your zip file.

Please rewrite this line like this.

Before

extension SAHistoryNavigationViewController: SAHistoryViewControllerDelegate {
    func historyViewController(viewController: SAHistoryViewController, didSelectIndex index: Int) {
        if viewControllers.count - 1 < index {
            return
        }

        popToViewController(viewControllers[index], animated: false)

        viewController.dismissViewControllerAnimated(true) { finished in
            self.historyViewController = nil
            self.setNavigationBarHidden(false, animated: false)
        }
    }
}

After

extension SAHistoryNavigationViewController: SAHistoryViewControllerDelegate {
    func historyViewController(viewController: SAHistoryViewController, didSelectIndex index: Int) {
        if viewControllers.count - 1 < index {
            return
        }

        viewController.dismissViewControllerAnimated(true) { finished in
            self.historyViewController = nil
            self.popToViewController(self.viewControllers[index], animated: false)
            self.setNavigationBarHidden(false, animated: false)
        }
    }
}

@pepejeria
Copy link
Author

That fixes the issue, the warning no longer appear. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants