Latest 1.0.0
Homepage https://github.com/xmartlabs/XLMailBoxContainer
License MIT
Platforms ios 7.0, requires ARC
Authors

This repository is no longer maintained. Take a look at XLPagerTabStrip for a better solution.

By XMARTLABS.

Custom container view controller ala MailBox app.

XLSwipeContainerController is the most important class of the library. Just using this class you can get the same functionality shown on the gif bellow.

XLSwipeContainerController handles a collection of childViewControllers created by the developer and also manages a UISegmentedControl, adding it to the parent UINavigationController and changing the color of it depending on which child view controller is selected.

XLSwipeNavigationController give us the possibility to create the UINavigationController along with the XLSwipeContainerController just passing a list of childViewControllets.

Each childViewController must conform XLSwipeContainerChildItem protocol.

You can use this pod along with MCSwipeTableViewCell to create an app that looks like MailBox app.

XLMailBoxContainer

Installation

The easiest way to integrate XLMailBoxContainer in your projects is via CocoaPods.

  1. Add the following line in the project’s Podfile file.

pod 'XLMailBoxContainer'

  1. Run the command pod install from the Podfile folder directory.

You can also install XLMailBoxContainer manually. We don’t recommend this approach at all.
The source files you will need are included in XLMailBoxContainer/XL folder.

Example

Look at AppDelegate.m file.

The first think we should do is create each child viewController.

// create child view controllers that will be managed by XLSwipeContainerController
MailBoxTableChildViewController * child_1 = [[MailBoxTableChildViewController alloc] initWithStyle:UITableViewStylePlain];
MailBoxChildViewController * child_2 = [[MailBoxChildViewController alloc] init];
MailBoxTableChildViewController * child_3 = [[MailBoxTableChildViewController alloc] initWithStyle:UITableViewStyleGrouped];
MailBoxChildViewController * child_4 = [[MailBoxChildViewController alloc] init];

The second step is either create XLSwipeNavigationController using the child view controllers previously created or set up a XLSwipeContainerController and set it as rootViewController of any UINavigationController.

// create XLSwipeNavigationController using the child view controllers previously created
self.window.rootViewController = [[XLSwipeNavigationController alloc] initWithViewControllers:child_1, child_2, child_3, child_4, nil];

or

NSArray * childViewControllers = @[child_1, child_2 ,child_3 ,child_4];
XLSwipeContainerController * containerController = [[XLSwipeContainerController alloc] initWithViewControllers:childViewControllers];
self.window.rootViewController = [[UINavigationController alloc] initWithRootViewController:containerController];

That’s all folks!

XLMailBoxContainer files

  1. XLSwipeContainerController handles a collection of childViewControllers created by the developer and also manages a UISegmentedControl, adding it to the parent UINavigationController and changing the color of it depending on which child view controller is selected.

  2. XLSwipeNavigationController give us the possibility to create the UINavigationController along with the XLSwipeContainerController just passing a list of childViewControllets.

License

XLMailBoxContainer is distributed under MIT license, please feel free to use it and contribute.

Contact

If you are using XLMailBoxContainer in your project and have any suggestion or question:

Martin Barreto, [email protected]

@Xmartlabs

Latest podspec

{
    "name": "XLMailBoxContainer",
    "version": "1.0.0",
    "license": "MIT",
    "summary": "Custom container view controller ala MailBox app.",
    "description": "                    Custom container view controller ala MailBox app. It uses a segmented control as a navbar and animates view controller transitions.n",
    "homepage": "https://github.com/xmartlabs/XLMailBoxContainer",
    "authors": {
        "Martin Barreto": "[email protected]"
    },
    "source": {
        "git": "https://github.com/xmartlabs/XLMailBoxContainer.git",
        "tag": "v1.0.0"
    },
    "source_files": "XLMailBoxContainer/XL/*.{h,m}",
    "requires_arc": true,
    "platforms": {
        "ios": "7.0"
    },
    "ios": {
        "frameworks": [
            "UIKit",
            "Foundation"
        ]
    }
}

Pin It on Pinterest

Share This