Adding a common view for all view controllers in the UITabbarController

I am trying to develop something like a play bar in Apple Music. The general view that appears at the bottom of all UITabbarContoller view controllers. Is there any idea or best practice to achieve this? enter image description here

Ok i just put my personal decision

  • subclass of view controller for general view.
  • attach the view controller as the controller of the child view of the tab bar controller.

I don't like to embed a view controller in a tab bar controller. Just let me know if there is a better solution.

+4
source share
5

UITabBar UINavigationController, UIViewController s. , - UINavigationController. , UINavigationController.

+2

subview

 [self.window addSubview:vw];

 vw.tag = 10000;

+1

segue , .

 - (IBAction)YourButton:(id)sender
   {
       [self performSegueWithIdentifier:@"segueIdentifier" sender:self];
   } 

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
  {
      if ([segue.identifier isEqualToString:@"segueSearchList"])
      {
           // Do what you want to do
      }

   }

, ,

0

You have a ParentViewontroller class that has a tab at the bottom and inherits this class to view controllers that need a panel and handle things.

0
source

You can make xib for your view or a class inherited from UIView and add it to any controller you want.

0
source

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


All Articles