How to use a uittabbar controller with a xib? - ios

So I'm trying to use a uitabbarcontroller. I use interface builder and drag it like usual.
I then try and drag another view controller onto this
But this leads to this-
So I can't see two view controllers.
So how do I actually use this with a xib?

Add UIViewController in Xib not on UITabController. Then link UIViewController to UITabController.

Related

Have a UIContainerView point to a ViewController in another Storyboard?

I understand that UIContainerView can be used to embed a UIViewController inside another UIViewController in a Storyboard. However, I would like the embedded UIViewController to live in a different Storyboard file. Is this possible, and if so, how do I make the connection?
You can do that by following the these steps:
In the Storyboard that contains the view controller you want to segue to, set the Storyboard ID for that view controller.
In the storyboard containing the container view, drag a Storyboard Reference from the Object library.
From the attribute inspector, set the Storyboard that contains the view controller you want to segue to, and set the Referenced ID to the ID you set in step 1.
Connect the embed segue between your container view and the storyboard reference like if it is a view controller in the same storyboard.
That's all!

Subclass from the subclass of UIViewController with Storyboard doesn't work as except

I have two view controllers, one subclass UIViewController
class MGStatusViewController: UIViewController
with storyboard identifier "MGStatusViewController".(With some UIButtons)
And the other subclass **MGStatusViewController**
class MGStatusDetailViewController: MGStatusViewController
with storyboard identifier MGStatusDetailViewController
When i use it like this:
self.storyboard?.instantiateViewControllerWithIdentifier("MGStatusDetailViewController") as? MGStatusDetailViewController
There's no controllers(the UIButtons) from MGStatusViewController's storyboad file.
How should i achieve this? Thanks!
When you inherit your custom view controller - in this example MGStatusViewController you inherit code behind and logic. You can connect your outlets for MGStatusDetailViewController with MGStatusViewController. And that is it. You can't inherit UIView controls from the storyboard and expect them to show.
What you can do is to create MGStatusDetailViewController take the view from it and add it to the MGStatusViewController. Or, you can create embed control and embed MGStatusDetailViewController in MGStatusViewController. This way you will have all the controls from storyboard and will present your MGStatusDetailViewController
In short, inheritance does not take Views from storyboard, only code from that view controller.
Furthermore, when you inherit from view controllers, you use them as an abstract. You create some logic for that will be used on others view controllers, but you don't create actual UI.
Why you use "MGStatusDetailViewController" story board identifier if you have set identifier as "MGStatusViewController"
Storybord ID and class are diferent thing.
You may try with this -
self.storyboard?.instantiateViewControllerWithIdentifier("MGStatusViewController") as? MGStatusDetailViewController

Adding Outlets to View Controller via Table View Controller

I'm attempting to create an application for iOS, using Xamarin and storyboards. Within this, there shall be a button located in a TableViewController which will navigate the user.
To do this, I've used a Container, embedded to a TableViewController. However, my concern is I wish to add an Outlet from the button within the TableViewController to the ViewController header class - Yet it only allows me to try and add one to the 'UITableViewController.h' file.
What is causing this and how am I able to add the Outlet to the 'ViewController.h' file? (Extremely sorry if this makes little sense)
You should not use both the UITableViewController and the UIViewController. UITableViewController is a subclass of UITableViewController so all you need the UITableViewController and you should drag the outlet to it.

How to initialize UITableViewController inside a UISplitViewController?

I just dragged out a UISplitView from the storyboard and set the classes of the root and detail view controllers. I am wondering how to initialize my UITableViewController (as it needs some setup before it is read to be used). This might be easier if I create the UISplitView programmatically. Still, is there a way for me to set up my UITableViewController in the UISplitView? Thanks!
You can just drag and drop a UISplitView to your storyboard and create master view and detail view classes in your bundle. Then assign each class to each viewcontrollers in xib :

Storyboard add viewcontroller's view into another viewcontroller iOS5+

Anyone know if it is possible to create your views in the storyboard which can be used for a main view?
I have tried instantiating my viewcontroller with the identifier and then adding the view from the viewcontroller, but the frame isn't the same as the frame I used in the storyboard.
I know it is possible to use the container view in the storyboard. But I cant use that in iOS 5.0.
Do not create viewcontroller in storyboard. Create a separate xib file then instantiate controller using xib and add the view as subview in main view.

Resources