ViewModel View Controller Problem

Hi Everyone, I have a problem with the current model view controller. Here's the script:

  • This is a navigation bar app. I have a UIViewController class to which I add another UIView Controller class using this operator [self.view addSubView:controllerClass] ;

  • In the CLASS controller, I have a tab bar at the bottom, and also record its delegates on each tab bar. I will add another UIViewController class to it as a subView, but I will make the height or frame this controller matter (0,0,320,369) . so that the tab bar is displayed when we click on different tabs.

  • By clicking on the first tab, the ScannerViewController adds a subview. This view has a gallery button. when the user clicks on it, inserts the current model view controller into it and hides the navigation panel, when I select an image from the gallery and create the hidden =NO navigation panel, it does not work, and the tab bar below decreases.

+6
source share
1 answer

It looks like you are abusing the design of the tab bar. Each tab in the tab bar should have its own UINavigationController, and not use one controller for each tab.

Also, in my experience, it is best to present a modal view controller using the lower-level view of AppDelegate. That is, the view that was added to the UIWindow object when the application started.

+3
source

Source: https://habr.com/ru/post/892642/


All Articles