Skip to content

iaaqibhussain/AHContainerViewController

Repository files navigation

AHContainerViewController

Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

iOS 8.0+

Installation

AHContainerViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "AHContainerViewController"

Setup

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.

alt tag


Now select the segue attached to the Container View Controller and add an identifier.

alt tag


Attach ViewControllers to the Container View Controller and set the segue's custom class to AHEmptySegue.

alt tag


Finally give the identifier of the ViewController you want to show when the Container View first loads.

alt tag


Usage

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.

Using with Swift

In your Bridging-Header.h file add:

#import <‍AHContainerViewController/AHContainerViewController.h‍> 

Don't forget to import AHContainerViewController in the class where using it.

Author

Aaqib Hussain, [email protected]

License

AHContainerViewController is available under the MIT license. See the LICENSE file for more info.

About

Helper class for using Container Views in iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published