0

I shift my TabBar to top like bellow:

class RootMainFatherTabBarUITabBarController: UITabBarController {

    override func viewDidLoad() {
        super.viewDidLoad()
    }

    override func viewWillLayoutSubviews() {
        //Shift tabs to top page
        tabBar.frame = CGRect(x: 0, y: 0, width: tabBar.frame.size.width, height: tabBar.frame.size.height)
        super.viewWillLayoutSubviews()

    }
}

But TabBar overlay on view and i can't see segue!

jo jo
  • 1,758
  • 3
  • 20
  • 34
  • 1
    A `UITabBarController` is not designed to be at the top of the screen and you are going to be fighting all kinds of issues if you try to make it. I would suggest re-thinking your interface instead. – Upholder Of Truth Jul 18 '19 at 10:10
  • @ Upholder Of Truth. What can I do? – jo jo Jul 18 '19 at 10:13
  • In what way? You can design a different style interface isn't based on a `UITabBarController`. Perhaps make your own custom version if you really want it to be like that. – Upholder Of Truth Jul 18 '19 at 10:14
  • I can use from other way but what way? – jo jo Jul 18 '19 at 10:15
  • That's going to depend on what you want it to look like. You could use some kind of menu instead or make a custom button bar that switches the view controllers. There are many different options I was just trying to avoid you wasting time trying to bend the `UITabBarController` to do what it's not designed to do. – Upholder Of Truth Jul 18 '19 at 10:17
  • I just need to pass tab bar to top and set view under the tab bar. :( – jo jo Jul 18 '19 at 10:30
  • Ok if you mean it's overlaying the status bar then you can do something like this: ` self.tabBar.frame = CGRect(origin: CGPoint(x: 0, y: UIApplication.shared.statusBarFrame.size.height), size: self.tabBar.frame.size) `. I would also put it after the call to super so that is all complete. The point I am trying to make though is that it would be better not to do that at all as it will break the Apple HIGs. – Upholder Of Truth Jul 18 '19 at 18:41

1 Answers1

0

you can add tabbar by easy and fast way just open ui-control-view and drag and drop tabbar ADD tab and just click and swipe and drop on the nav view thats you want to open

Muhammad Ahmad
  • 388
  • 4
  • 9