material-components-ios icon indicating copy to clipboard operation
material-components-ios copied to clipboard

[MDCAppBarNavigationController] Unable to swipe from pushed view to parent view

Open SamboVisal opened this issue 5 years ago • 5 comments

For usage questions: ask on Stack Overflow.

Hello guys, I am using component named MDCAppBarNavigationController to custom navigation controller instance that auto-injects App Bar instances into pushed view controllers. After view controller has pushed I am not able to use left swipe gesture in order to get back from parent view. Unlike UIKit, after view controller has been pushed then we can use left gesture to get back to rootViewController.

Reproduction steps

Steps to reproduce the behavior:

  1. Initially, I created MDCTabbarViewController for storing many child viewcontrollers.

  2. Each child view controllers is customized with MDCAppBarNavigationController let thirdVC = MDCAppBarNavigationController(rootViewController: TodoViewController()) thirdVC.delegate = self thirdVC.tabBarItem = UITabBarItem(title: "To-Do", image: nil, tag: 2) These lines of code is written in main class that custom with MDCTabbarViewController

  3. So, inside child view class TodoViewController() I created UIBarButtonItem in order to push to another view controller self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Detail", style: .plain, target: self, action: #selector(detailTodo))

@objc func detailTodo() { let controller = ToDoDetailViewController() self.navigationController?.pushViewController(controller, animated: true) }

Expected behavior

After view controller has been pushed so, we can use left swipe gesture to go back to parent view. If user click on tabbarItem also go back to parent view as well.

Actual behavior

  1. So, When I tapped on right bar button item the view controller has pushed somoothly and it provides left bar button item with back icon. So, I can click on that to get back to parent view. Based on user experience I want to user also use left swipe gesture in order to get back to parent view as well but it does not work.
  2. One more issue is that as you know that the main view controller is MDCTabbarViewController So, when I click on particular tabbarItem also gets back to parent view but it does not work.

Platform (please complete the following information)

  • Device: [e.g. iPhone6 plus]
  • OS: [e.g. iOS11]

Additional context


Internal data

SamboVisal avatar Apr 09 '19 08:04 SamboVisal

The title doesn't have a [Component] prefix.

Hello! Anything new about this? I am experiencing the same problem. Greetings and thank you

javiertorne avatar Dec 09 '19 18:12 javiertorne

Thanks, @javiertorne. I'm assigning this to our Product Manager to review its position in the backlog.

romoore avatar Dec 09 '19 18:12 romoore

this still hasn't been fixed? because I still can't use the swipe from left edge to right to go back to the previous controller.

atebitsy avatar Nov 09 '20 13:11 atebitsy

As noted in #10115

I have managed to work around this issue following the steps noted in this commit (I think it is occurring as I have hidden the navigation bar in the view controller): https://github.com/material-components/material-components-ios/commit/1aadd7f468d1d00b7fcbc6c4f9979986229f3df7

intiocean avatar Apr 30 '21 11:04 intiocean