MSSidebarController 1.0.6

MSSidebarController 1.0.6

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

Maintained by Nacho Soto.



 
Depends on:
TransitionKit~> 2.0.0
libextobjc~> 0.3
 

  • By
  • Nacho Soto

Description:

Sidebar controller with customizable animations, implemented using a state machine.

How to Use:

You must instantiate the controller with the menu, and the currently active view controller:

[[MSSidebarController alloc] initWithMenuViewController:menuVC
                                   activeViewController:activeVC
                                        animatorFactory:animatorFactory];

You must also implement all three animation protocols:

@protocol MSSidebarDisplayViewControllerAnimator <NSObject>

- (void)sidebarController:(MSSidebarController *)sidebarController
willDisplayViewController:(UIViewController *)newViewController
          completionBlock:(void (^)(void))completionBlock;

@end

@protocol MSSidebarDisplayMenuAnimator <NSObject>

- (void)sidebarController:(MSSidebarController *)sidebarController
willDismissViewController:(UIViewController *)currentViewController
           andDisplayMenu:(UIViewController *)menuController
          completionBlock:(void (^)(void))completionBlock;

@end

@protocol MSSidebarHideViewControllerAnimator <NSObject>

- (void)sidebarController:(MSSidebarController *)sidebarController
   willHideViewController:(UIViewController *)currentViewController
  toShowNewViewController:(UIViewController *)newViewController
          completionBlock:(void (^)(void))completionBlock;

@end

View controllers inside of MSSidebarController will have a sidebarController property set, which you can use to change the state of the controller. Example:

[self.sidebarController showMenu];
[self.sidebarController restoreLastViewController];
[self.sidebarController showViewController:SomeOtherController.new];

Instalation:

Just add this line to your Podfile:

pod 'MSSidebarController', '~> 1.0.0'
  • Manually:

Simply add the files under Classes to your project.

Compatibility

  • Supports iOS iOS7+.

License

MSSidebarController is available under the WTFPL license. See the LICENSE file for more info.