Giter Site home page Giter Site logo

xlmailboxcontainer's Introduction

XLMailBoxContainer

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.

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

xlmailboxcontainer's People

Contributors

mtnbarreto avatar romanroibu avatar

Watchers

gryphon avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.