Question: How can i create the viewcontroller for the tab bar ? I want that the bar is in that position [![enter image description here](https://i.stack.imgur.com/behpC.png)](https://i.stack.imgur.com/behpC.png)

Answer: 
1- Add a containerView right with the same frame as you want for the tabBar 

2- You will get a segue to an empty VC , select it and from menu Editor -> Embed in a tabBarcontroller

//

From object library drag a containerView

[![enter image description here](https://i.stack.imgur.com/pPcml.png)](https://i.stack.imgur.com/pPcml.png)

//

Select the segue destinaution VC and from Menu 

[![enter image description here](https://i.stack.imgur.com/1KJu6.png)](https://i.stack.imgur.com/1KJu6.png)

you will get

[![enter image description here](https://i.stack.imgur.com/gTMMl.png)](https://i.stack.imgur.com/gTMMl.png)
You can add a TabBarViewController as a childViewController.

1. Instantiate in YourViewControllers’ viewDidLoad the TabBarViewController.
2. Call `add(tabBarViewController)` (the extension below) inside YourViewControllers’ `viewDidLoad`.
3. Place an empty NSView inside YourViewController where you want the TabBarViewController to be. The added NSView is your tabBarAnchor.
4. Create a IBOutlet to your tabBarAnchor inside YourViewController.
5. Then inside the YourViewControllers’ `viewDidLout` you constrain the edges of your tabBarViewController to the tabBarAnchor.

Then you should see your TabBarViewController correctly placed inside YourViewController.

```
extension UIViewController {
    func add(_ child: UIViewController) {
        addChildViewController(child)
        view.addSubview(child.view)
        child.didMove(toParentViewController: self)
    }
    func remove() {
        guard parent != nil else {
            return
        }
        willMove(toParentViewController: nil)
        removeFromParentViewController()
        view.removeFromSuperview()
    }
}

```

Source: <https://medium.com/@johnsundell/using-child-view-controllers-as-plugins-in-swift-458e6b277b54>