material-components-ios
material-components-ios copied to clipboard
[MDCAppBarNavigationController] Unable to swipe from pushed view to parent view
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:
-
Initially, I created
MDCTabbarViewController
for storing many child viewcontrollers. -
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 withMDCTabbarViewController
-
So, inside child view class
TodoViewController()
I createdUIBarButtonItem
in order to push to another view controllerself.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
- 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.
- 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
- Associated internal bug: b/130301360
The title doesn't have a [Component] prefix.
Hello! Anything new about this? I am experiencing the same problem. Greetings and thank you
Thanks, @javiertorne. I'm assigning this to our Product Manager to review its position in the backlog.
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.
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