Skip to content

paultopher/MGSwipeTabBarController

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

MGSwipeTabBarController

Example Screenshots

ScreenShot 1

ScreenShot 2 ScreenShot 3

Setup

  • Add the "MGSwipeTabBarController" Folder to your project
  • import "MGSwipeTabBarControllerHeaders.h" in your project's "…-Prefix.pch" file

Example Usage

Create a MGSwipeTabBarController

There is a couple ways in setting up your SwipeTabBarController

Here is the way without a tabBar:

NSArray *viewControllers = . . . //your view controllers
MGSwipeTabBarController *tabController = [[MGSwipeTabBarController alloc] initWithViewControllers:viewControllers]; 

Here is the way with a tabBar:

NSArray *viewControllers = . . . //your view controllers
TabBar *customTabBar = . . . //your tab bar
MGSwipeTabBarController *tabController = [[MGSwipeTabBarController alloc] initWithViewControllers:viewControllers tabBar:tabBar]; 

Here is the way with a tabBar and a custom tabBar position

  • Two options: MGTabBarPositionTop (Default) & MGTabBarPositionBottom
NSArray *viewControllers = . . . //your view controllers
TabBar *customTabBar = . . . //your tab bar
MGSwipeTabBarController *tabController = [[MGSwipeTabBarController alloc] initWithViewControllers:viewControllers tabBar:tabBar atPosition:MGTabBarPositionBottom]; 

Build your own custom TabBar

NOTE: TabBars are optional!
  • Subclass MGSwipeTabBar
  • remember to call the delegate method "[self.delegate swipeTabBarDidSelectIndex:YOUR_SELECTED_INDEX]" when a button was selected in tabBar
  • DO NOT call "[self.delegate swipeTabBarDidSelectIndex:YOUR_SELECTED_INDEX]" in setSelectedIndex:

Check out the Example Demo for a guide/example in subclassing MGSwipeTabBar (very simple, two method implementation)

About

Simple swipe tab bar controller for iOS - (Sort of like android page swiping, customization is up to you!)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published