Best practice for app using tab bar & nav bar

I am in the process of re-coding an app from the ground up. When this app runs it gets the following console error msg:


"... Presenting view controllers on detached view controllers is discouraged ..."


Because I have puzzled over that I coded up a demo app based on the app in question and in so doing eliminated the error. While that is good, it seems that I am adding a lot of navigation objects and am not certain that I am going about my re-coding in the best manner. I'll explain.


My app has four tab bar items: data, info, tip pref and email. Each represent a separate view/view controller.


Tapping the data tab bar segues to the detail view showing calculations based on user entered data in the data view textfields. The detail view hides the tab bar items and has a <Back button to segue back to the data view.


Tapping any of the remaining tab bar buttons segue the user to those views, but these views DO show all of the tab bar buttons. These views do not have a <Back button and rely on the tab bar button to segue to another view.


My question is this: Is it best to embed a navigaion controller in each view so that each view will have a <Back button to segue back and not show the tab bar buttons in each view?


As noted above, using this method eliminated the "...detached ..." error, so perhaps this is the best coding practice.


Any comments or suggestions are most welcome.


Thanks!

Accepted Reply

See this link on 'order of containment' to confirm your UI:


https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/CombiningViewControllers.html


Combined View Controller Interfaces

Replies

See this link on 'order of containment' to confirm your UI:


https://developer.apple.com/library/ios/documentation/WindowsViews/Conceptual/ViewControllerCatalog/Chapters/CombiningViewControllers.html


Combined View Controller Interfaces

@KMT

Anyone please specify how to achieve this in SwiftUI. I'm getting this warning in SwiftUI TabBar View. While NavigationLink, onTap is not working.

Thanks in Advance.