Xcode 4.5 Update Container View? - iphone

With the new 'Container View' for iOS in Storyboards of Xcode 4.5, how do I reload/update one?
In my app, I have a container view which holds a UITableViewController. From my main view controller (the one with the container view) I need to updates the table view in the container.

Related

How do I get a crossfade transition with resize on macos using storyboard & NSTabViewController?

On a brand new MACOS application project (swift, storyboards), using the latest available version of xCode (8.3) I can't get a crossfade transition with a NSTabViewController that I add to my story board. The window is not resizing as well.
What am I doing wrong ?
I start by adding a new window controller, I remove its content view controller that I replace by a tabviewcontroller.
The tabview controller comes with two tabs wired to two view controllers. I resize one of them to make it bigger and put random buttons on both of them to be able to check wether the full view is visible or not at runtime.
Everything is left with default settings, as well as the "crossfade" transition of the tabviewcontroller.
But when running the application, tabs change abruptly, and the window doesn't resize to display the new tab.
My goal is to build a preference panel on my storyboard ans I just fail on the first steps.
For crossfade animation to work, you need to connect delegate outlet of the tab view to the tab view controller.
It does not seem smooth resize is supported by the standard tab view, though.

Loading views into NSContainerView with swift

I have a storyboard setup with the main view having a bunch of buttons and a container view and I would like for a different view to be loaded into that container view each time I press one of those buttons, kind of like a tab view controller works but without using one of those.
Also, later on I plan to have buttons inside those views that load other views replacing the views themselves.
Anyone can give me some hints?
Thanks
"Container View defines a region within a view controller's view subgraph that can include a child view controller. Create an embed segue from the container view to the child view controller in the storyboard."
You mentioned NSContainerView, so I assume you're trying to do this on macOS, not iOS. Here's a useful article and code project (for iOS 6, but I was able to set up switchable subviews in iOS 9 using this as a guide):
http://sandmoose.com/post/35714028270/storyboards-with-custom-container-view-controllers
The important bits are using the embed segue, then wiring the view controllers together through a combination of viewDidLoad and prepareForSegue, and then finally loading one of the switchable view controllers (say one for each of your buttons) from the storyboard, where they are not connected to anything else.

How to move a container View in Swift

How to move a container View in Swift
I'm working on an app that will be just for iPad, and because of the size I am using containers to embed other views. In this app, I need to move a viewController that is within a container.
For example, I created a ViewController and put a Container View. I must use the UIPanGesture in the label, and drag your finger across the screen, move the ContainerView in ViewControler Initial.
Can someone help me?
The container view is just a normal UIView.
Just create a view outlet to your View Controller if you want to move the view using it's frame.
You probably know how to create an outlet connection ?
You can also use Auto Layout and created outlets to your constraints and change their value.

Two UIViewControllers on one screen without SplitViewController

How can I bring two uiviewcontrollers onto one screen with out using splitviewcontroller in story board ?
I don't think that is possible in the story board. You have to do that programmatically using addChildViewController: (UIViewController Class Reference Scroll down to "Implementing a Container View Controller"). Container View Controller is a feature introduced in iOS 5.
The only possible way that I could think about doing this is adding two Container Views in one View Controller and then giving each container view a class. You can find the container views in your objects library under "Container View"

UITableViewCell in iPad master detail UISplitView does not automatically respond to orientation changes

In xcode 4.2, if you set up a new project for both iPhone and iPad and choose to create a new iOS "Master-Detail Application" Xcode will set up a lot of template code for you. The iOS "version" of the application has a different simpler storyboard. I want the detail view of my application to also be a Table View controlled by a table controller and I want the cells of this table view to automatically resize with an orientation change. The problem is that while this works for the iPhone version of the application, it doesn't work for the iPad version.
Pre-conditions:
If you edit the detail view on the iPhone storyboard so that it contains a Table View Controller and define the table view to contain a single prototype cell - set the prototype cell to be of a custom type and add some subviews to it then define those subviews with auto resize properties (for example two buttons - one fixed to the left side of the view, the other to the right margin of the view). Do the same for detail view of the iPad storyboard (which of course is contained in a more complex split view controller arrangement).
Double check all the view controllers have resize view from NIB selected (which they do by default) and all the views have Autoresize Subviews selected.
Expected:
When the application is compiled for either iPhone or iPad, in both cases the table cell and it's subviews should resize on orientation change.
Actual Result:
On the iPad version of the app the table cell does not re-layout to match the changed size of the UITable view. The table cell on the iPhone version of the app behaves as expected.
It's clear the chain of subview layout for nested views is broken such that re-layout subviews is not occurring or getting called all the way down to the table view cell when an orientation change occurs. Anyone know if this can be fixed in Interface Builder or if not what code is required to re-establish the chain? I know how I can fix this using willRotateToInterfaceOrientation:duration: , in my own custom subclass of UITableViewController but I'm not sure doing it this way is clean and I would prefer not to have partial automation of orientation changes with scraps of code providing workarounds for stuff I think it should be possible to automate.