In the interface builder there are few parameters for UIView of UIViewController: topBar, bottomBar, ...
interface builder parameters of view
What happens when i set Navigation Bar value for Top Bar parameter, and Tab bar for Bottom Bar parameter? It is very useful to me.
So, how can i do it programmatically?
Actually this parameters are using for building correct interface and even if you will set this bars in Xcode Interface Builder, they will not appear, if you are not using you UIViewController inside some UIViewController containers.
As example if you will add your UIVIewController into UINavigationController, then you will see Navigation Bar as top Bar. This Simulated metrics have no effect in the program, but they will help you to build correct interface, if you expect to use UIViewController inside container.
But if you want to add this Parts of interface programmatically inside your UIViewController, you can use according subiews. As example:
UINavigationBar *yourBar = [[UINavigationBar alloc] init];
[self.view addSubview:yourBar];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With