У меня есть вопрос по поводу моего стека навигации. Это не ведет себя так, как я хочу. У меня есть RequestDetailsViewController, который я хочу представить из моего RequestsViewController. Однако, когда я делаю шоу или подарок:
let navigationController = NavigationController(rootViewController: RequestDetailsViewController(request: serviceRequest))
self?.show(navigationController, sender: self)
<ProHomeTabBarViewController 0x7f9152043800>, state: appeared, view: <UILayoutContainerView 0x7f9151520c40>
| <UINavigationController 0x7f9152059000>, state: disappeared, view: <UILayoutContainerView 0x7f9151529530> not in the window
| | <ProDashboardViewController 0x7f9141569c70>, state: disappeared, view: <UIView 0x7f9151459a10> not in the window
| <UINavigationController 0x7f915189be00>, state: appeared, view: <UILayoutContainerView 0x7f9151466390>
| | <RequestsViewController 0x7f91448231e0>, state: appeared, view: <UIView 0x7f915152fda0>
| <UINavigationController 0x7f9151890c00>, state: disappeared, view: <UILayoutContainerView 0x7f915146ec00> not in the window
| | <ProDashboardViewController 0x7f915146bc90>, state: disappeared, view: (view not loaded)
| <UINavigationController 0x7f91518a6e00>, state: disappeared, view: <UILayoutContainerView 0x7f9151473450> not in the window
| | <PayoutsViewController 0x7f9151470fa0>, state: disappeared, view: (view not loaded)
| <UINavigationController 0x7f915206a000>, state: disappeared, view: <UILayoutContainerView 0x7f915152d3c0> not in the window
| | <ProProfileViewController 0x7f9151475690>, state: disappeared, view: (view not loaded)
+ <NavigationController 0x7f9153163a00>, state: appearing, view: <UILayoutContainerView 0x7f9151787320>, presented with: <_UIPageSheetPresentationController 0x7f9151789210>
| | <RequestDetailsViewController 0x7f915389c000>, state: disappeared, view: <UIView 0x7f9151790070> not in the window)
Как показано выше, это представляет из root ProHomeTabBarViewController. Тем не менее, я хочу, чтобы он представлял из RequestsViewController, чтобы я мог ссылаться на него, когда я отклонить RequestsDetailsViewController. Можете ли вы сообщить мне, если это неправильный подход или что-то другое должно быть сделано в этой ситуации?
Когда я делаю Pu sh с контроллера навигации, он корректно добавляется в стек навигации RequestsViewController как показано ниже:
<ProHomeTabBarViewController 0x7fc066039600>, state: appeared, view: <UILayoutContainerView 0x7fc065589d40>
| <UINavigationController 0x7fc06604ce00>, state: disappeared, view: <UILayoutContainerView 0x7fc065595520> not in the window
| | <ProDashboardViewController 0x7fc06561e030>, state: disappeared, view: <UIView 0x7fc06560d390> not in the window
| <UINavigationController 0x7fc055841000>, state: appeared, view: <UILayoutContainerView 0x7fc05562a7e0>
| | <RequestsViewController 0x7fc06559dd10>, state: appeared, view: <UIView 0x7fc055639530>
| | <RequestDetailsViewController 0x7fc056077a00>, state: disappeared, view: <UIView 0x7fc065499d60> not in the window
| <UINavigationController 0x7fc055851000>, state: disappeared, view: <UILayoutContainerView 0x7fc055630490> not in the window
| | <ProDashboardViewController 0x7fc05562d520>, state: disappeared, view: (view not loaded)
| <UINavigationController 0x7fc05681ce00>, state: disappeared, view: <UILayoutContainerView 0x7fc061213100> not in the window
| | <PayoutsViewController 0x7fc055632830>, state: disappeared, view: (view not loaded)
| <UINavigationController 0x7fc06703f600>, state: disappeared, view: <UILayoutContainerView 0x7fc065627dd0> not in the window
| | <ProProfileViewController 0x7fc0612158e0>, state: disappeared, view: (view not loaded)
Фактически это происходит всякий раз, когда я представляю что-либо из дочерних контроллеров ProHomeTabBarViewController. Также, если я оберну ProHomeTabBarController в другом родительском контроллере маршрутизации и попытаюсь представить один из дочерних контроллеров представления, новый контроллер представит контроллер маршрутизации, как показано ниже.
<ProRoutingViewController 0x7fd69b428540>, state: appeared, view: <UIView 0x7fd68b667ed0>
| <ProHomeTabBarViewController 0x7fd68c822600>, state: appeared, view: <UILayoutContainerView 0x7fd68b6691b0>
| | <UINavigationController 0x7fd69d82d600>, state: disappeared, view: <UILayoutContainerView 0x7fd69e018360> not in the window
| | | <ProDashboardViewController 0x7fd69b53bfc0>, state: disappeared, view: <UIView 0x7fd69b724c10> not in the window
| | <UINavigationController 0x7fd69b855a00>, state: disappeared, view: <UILayoutContainerView 0x7fd69b431580> not in the window
| | | <RequestsViewController 0x7fd69e01f300>, state: disappeared, view: <UIView 0x7fd69b7443a0> not in the window
| | <UINavigationController 0x7fd69b854200>, state: appeared, view: <UILayoutContainerView 0x7fd69b4362b0>
| | | <ProDashboardViewController 0x7fd69b433340>, state: appeared, view: <UIView 0x7fd69b573040>
| | <UINavigationController 0x7fd68c815600>, state: disappeared, view: <UILayoutContainerView 0x7fd68b65a4f0> not in the window
| | | <PayoutsViewController 0x7fd69b438650>, state: disappeared, view: (view not loaded)
| | <UINavigationController 0x7fd68c814600>, state: disappeared, view: <UILayoutContainerView 0x7fd68b670160> not in the window
| | | <ProProfileViewController 0x7fd68b66d530>, state: disappeared, view: (view not loaded)
+ <NavigationController 0x7fd69c01a000>, state: appearing, view: <UILayoutContainerView 0x7fd69b584b10>, presented with: <_UIPageSheetPresentationController 0x7fd69b5676c0>
| | <CompletedJobViewController 0x7fd69c01c200>, state: disappeared, view: <UIView 0x7fd69b5921f0> not in the window