https://github.com/msaps/MSSTabbedPageViewController
[DEPRECATED] A container UIViewController that provides a simple to implement page view controller with scrolling tab bar.
https://github.com/msaps/MSSTabbedPageViewController
Last synced: 11 months ago
JSON representation
[DEPRECATED] A container UIViewController that provides a simple to implement page view controller with scrolling tab bar.
- Host: GitHub
- URL: https://github.com/msaps/MSSTabbedPageViewController
- Owner: msaps
- License: other
- Archived: true
- Created: 2016-01-14T16:08:34.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-04-24T20:12:37.000Z (about 9 years ago)
- Last Synced: 2025-07-07T23:27:08.066Z (12 months ago)
- Language: Objective-C
- Homepage:
- Size: 1.75 MB
- Stars: 162
- Watchers: 11
- Forks: 37
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
**MSSTabbedPageViewController is now deprecated, and a new Swift component is available in the form of [Tabman](https://github.com/MerrickSapsford/Tabman). Unfortunately this can't be made compatible with Objective-C.**
**A seperate component, [Pageboy](https://github.com/MerrickSapsford/Pageboy) is available to provide the UIPageViewController enhancements present in MSSTabbedPageViewController and much more.**
# MSSTabbedPageViewController
[]()
[](https://travis-ci.org/msaps/MSSTabbedPageViewController)
[]()
MSSTabbedPageViewController is a UIViewController that provides a simple to implement page view controller with scrolling tab bar. It also includes a UIPageViewController wrapper that provides improved data source and delegation methods.
## Example
To run the example project, clone the repo and build the project. Examples are available for both Objective-C and Swift projects.
## Installation
MSSTabbedPageViewController is available through [CocoaPods](http://cocoapods.org). To install it, simply add the following line to your Podfile:
pod 'MSSTabbedPageViewController'
And run `pod install`.
## Usage
To use the tabbed page view controller, simply create a `UIViewController` that is a subclass of `MSSTabbedPageViewController`. Then implement the following data source method:
```
// array of view controllers to display in page view controller
- (NSArray *)viewControllersForPageViewController:(MSSPageViewController *)pageViewController;
```
If you are using a `UINavigationController` (As shown in Example project) you can embed the tab bar in the navigation bar. Simply set the `UINavigationBar` class in the navigation controller to `MSSTabNavigationBar` and the navigation bar will attach to the view controller.
To manually attach a tab bar view to the `MSSTabbedPageViewController`:
- Set the `tabBarView` property of the `MSSTabbedPageViewController` to an `MSSTabBarView` instance (Note: `tabBarView` is weak and an `IBOutlet`).
- Set the `dataSource` and `delegate` properties of the `MSSTabBarView` instance to the `MSSTabbedPageViewController` (Both are `IBOutlet`able).
To customise the content of the tabs in the tab bar override the following:
```
- (void)tabBarView:(MSSTabBarView *)tabBarView
populateTab:(MSSTabBarCollectionViewCell *)tab
atIndex:(NSInteger)index;
```
### Page View Controller Enhancements
MSSPageViewController is a UIViewController wrapper for UIPageViewController that provides a simpler data source and enhanced delegation methods. The data source methods are encapsulated in the `MSSTabbedPageViewControllerDataSource` as seen above.
The delegate methods that `MSSPageViewControllerDelegate` provides are listed below:
```
- (void)pageViewController:(MSSPageViewController *)pageViewController
didScrollToPageOffset:(CGFloat)pageOffset
direction:(MSSPageViewControllerScrollDirection)scrollDirection;
```
Called when the page view controller is scrolled by the user to a specific offset, similar to `scrollViewDidScroll`. The pageOffset maintains the current page position and a scroll direction is provided.
```
- (void)pageViewController:(MSSPageViewController *)pageViewController
didScrollToPage:(NSInteger)page;
```
Called when the page view controller completes a full scroll to a new page.
## Appearance
`MSSTabBarView` provides properties for appearance customisation, including:
- `sizingStyle` - Whether the tab bar should size to fit or equally distribute its tabs.
- `tabStyle` - The style to use for tabs, either `MSSTabStyleText` for text or `MSSTabStyleImage` for images.
- `indicatorStyle` - The style to use for the current tab indicator.
- `indicatorAttributes` - Appearance attributes for current tab indicator.
- `tabAttributes` - Appearance attributes for tabs.
- `selectedTabAttributes` - Appearance attributes for the selected tab.
- `selectionIndicatorTransitionStyle` - The transition style for the selection indicator.
- `MSSTabTransitionStyleProgressive` to progressively transition between tabs.
- `MSSTabTransitionStyleSnap` to snap between tabs during transitioning.
- use `setTransitionStyle:` to set both the `selectionIndicatorTransitionStyle` and `tabTransitionStyle`.
- `tabTransitionStyle` - The transition style to use for the tabs.
## Requirements
Supports iOS 8 and above.
## Author
Merrick Sapsford
Mail: [merrick@sapsford.tech](mailto:merrick@sapsford.tech)