MFPageFlowView 1.0.1

MFPageFlowView 1.0.1

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Kyle Fuller, Calvin Cestari.



  • By
  • Kyle Fuller

A paging flow view, similar to the scrollable iOS App Store screenshots.

Usage

MFPageFlowView is really simple to use, simply conform to the MFPageFlowViewDataSource protocol and you can provide views for each "page".

You have to implement two methods, one for providing the amount of pages and another for providing the page views.

@protocol MFPageFlowViewDataSource <NSObject>

- (NSUInteger)numberOfPagesInFlowView:(MFPageFlowView*)flowView;

- (UIView*)pageFlowView:(MFPageFlowView*)flowView
     viewForPageAtIndex:(NSUInteger)index;

@end

You can optionally set a page control and we will take care of maintaining the count and selected pages.

typedef NS_ENUM(NSUInteger, MFPageFlowViewLayoutOrientation) {
    MFPageFlowViewLayoutOrientationHorizontal,
    MFPageFlowViewLayoutOrientationVertical,
};

@interface MFPageFlowView : UIScrollView

@property (nonatomic, assign) MFPageFlowViewLayoutOrientation
layoutOrientation;

@property (nonatomic, assign) NSUInteger currentPage;
@property (nonatomic, weak) IBOutlet id<MFPageFlowViewDataSource> dataSource;

/** Once set, MFPageFlowView will update the page control */
@property (nonatomic, weak) IBOutlet UIPageControl *pageControl;

- (void)reloadData;

- (void)setCurrentPage:(NSUInteger)currentPage
              animated:(BOOL)animated;
@end

Installation

CocoaPods is the recommended way to add MFPageFlowView to your project.

Here's an example podfile that installs MFPageFlowView.

platform :ios, '5.0'

pod 'MFPageFlowView'

Note the specification of iOS 5.0 as the platform; leaving out the 5.0 will cause CocoaPods to fail with the following message:

[!] MFPageFlowView is not compatible with iOS 4.3.

Documentation

There is full documentation for MFPageFlowView, it can either be found on CocoaDocs or within the headers of MFPageFlowView.

License

MFPageFlowView is released under the MIT license. See LICENSE.