CocoaPods trunk is moving to be read-only. Read more on the blog, there are 19 months to go.
TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Mark Fayngersh.
Depends on: | |
KVOController | ~> 1.0 |
FRDLivelyButton | ~> 1.1.2 |
MFWalkthrough: A Container View Controller for iOS
You can find the sample project in Example/WalkthroughDemo.
MFWalkthroughDataSource
- Used to determine what property to observe to enable transitionsMFWalkthroughDelegate
- React to various transitions and states#import <MFWalkthrough/MFWalkthroughViewController.h>
@interface ViewController : UIViewController <MFWalkthroughDataSource, MFWalkthroughDelegate>
In the implementation,
// Initialize your view controllers
UIViewController *firstController;
UIViewController *secondController;
UIViewController *lastController;
// Create the MFWalkthroughViewController instance
MFWalkthroughViewController *walkthroughController =
[[MFWalkthroughViewController alloc]
initWithViewControllers:@[ firstController, secondController, lastController ]];
// Present the walkthrough controller
[self.navigationController pushViewController:walkthroughController
animated:YES];
Required data source method:
- (NSString *)walkthroughViewController:(MFWalkthroughViewController *)walkthroughViewController enableContinuePropertyForViewController:(UIViewController *)viewController {
return @"somePropertyThatDeterminesIfContinueIsEnabled";
}
Required delegate methods:
- (void)walkthroughViewController:(MFWalkthroughViewController *)walkthroughViewController willGoBackFromFirstViewController:(UIViewController *)firstViewController {
NSLog(@"I'm at the very beginning!");
}
- (void)walkthroughViewController:(MFWalkthroughViewController *)walkthroughViewController willContinueFromLastViewController:(UIViewController *)lastViewController {
NSLog(@"I'm at the very end!");
}
The following delegate methods are optional:
- (void)walkthroughViewController:couldNotContinueFromViewController:
- (void)walkthroughViewController:willContinueFromViewController:toViewController:
- (void)walkthroughViewController:willGoBackFromViewController:toViewController:
Refer to source documentation for more detail
MFWalkthrough is designed to be used in conjunction with UINavigationController, simplifying conditional transitions between view controllers depending on some intermediate state.
FRDLivelyButton is used to render the navigation buttons. You can customize the button colors and line widths via the following MFWalkthroughViewController
properties:
(UIColor *)navigationButtonColor
- Defaults to navigationBar.tintColor
(CGFloat)navigationButtonLineWidth
- Defaults to 3.0f
To run the unit tests:
$ cd Example
$ make install
$ make ci
Mark Fayngersh, [email protected]
MFWalkthrough is available under the MIT license. See the LICENSE file for more info.