To run the example project, clone the repo, and run pod install
from the Example directory first.
iOS 8.0+
AHContainerViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "AHContainerViewController"
After installing the pod in your project or adding both of the classes i.e. AHContainerViewController and AHEmptySegue. Drag a Container View Controller in your project and from identity inspector select the view attached to it and set its class as AHContainerViewController.
Now select the segue attached to the Container View Controller and add an identifier.
Attach ViewControllers to the Container View Controller and set the segue's custom class to AHEmptySegue.
Finally give the identifier of the ViewController you want to show when the Container View first loads.
Method segueIdentifierReceivedFromParent
of class AHContainerViewController can be used to manipulate between the attached View Controllers by passing in the respective identifiers.
Property currentViewController
can be used anytime to know which View Controller is currently on the front and can further be used to get/pass data from/to attached View Controllers.
In your Bridging-Header.h
file add:
#import <AHContainerViewController/AHContainerViewController.h>
Don't forget to import AHContainerViewController
in the class where using it.
Aaqib Hussain, [email protected]
AHContainerViewController is available under the MIT license. See the LICENSE file for more info.