Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TomSwift committed Aug 14, 2013
2 parents 267ef57 + 42aed0a commit 50748cc
Show file tree
Hide file tree
Showing 7 changed files with 308 additions and 158 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
#MMDrawerController Changelog

##[0.3.0](https://github.com/mutualmobile/MMDrawerController/issues?milestone=6&page=1&state=closed) (Monday, July 22nd, 2013)
###New
* Added a block to determine if a gesture should be recognized, giving the implementer a chance to define where a gesture should be recognized within their views. Please consult the [README](https://github.com/mutualmobile/mmdrawercontroller#custom-gesture-recognizer-support) for additional details. ([#25](https://github.com/mutualmobile/MMDrawerController/pull/25)). (Kevin Harwood)
###Fixed
* **FIXED** an issue ([#56](https://github.com/mutualmobile/MMDrawerController/pull/56)) where the bezel gesture would be detected even if there was no drawer controller on that side. (Kevin Harwood)
* **FIXED** an issue ([#50](https://github.com/mutualmobile/MMDrawerController/pull/50)) where a subclass could get stuck in an infinite loop in the `init` method. (Tuan Cao)

##[0.2.1](https://github.com/mutualmobile/MMDrawerController/issues?milestone=7&state=closed) (Friday, June 21st, 2013)
###Fixed
* **FIXED** an issue([#42](https://github.com/mutualmobile/MMDrawerController/issues/42)) where the gesture completion block was not being called if the gesture action closed the drawer completely. (Kevin Harwood)

##[0.2.0](https://github.com/mutualmobile/MMDrawerController/issues?milestone=5&state=closed) (Tuesday, June 4th, 2013)
###New
* Added support for using the panning velocity to complete the animation. It now looks *much* better ([#18](https://github.com/mutualmobile/MMDrawerController/issues/18)). (Kevin Harwood)
* Added a new callback block to get notified when a gesture animation has completed ([#20](https://github.com/mutualmobile/MMDrawerController/issues/20)). (Kevin Harwood)

###Fixed
* **FIXED** an issue([#23](https://github.com/mutualmobile/MMDrawerController/issues/23)) where the drawer could bounce, even if a drawer was open. (Kevin Harwood)
* **FIXED** an issue([#38](https://github.com/mutualmobile/MMDrawerController/issues/38)) the designator initializer for `UIViewController` was not properly setting default values. (poteryaysya)
* **FIXED** an issue([#24](https://github.com/mutualmobile/MMDrawerController/issues/24)) where some documentation was incorrect. (Kevin Harwood)

##[0.1.0](https://github.com/mutualmobile/MMDrawerController/issues?milestone=3&page=1&state=closed) (Wednesday, May 15th, 2013)
###New
* `MMDrawerController` now properly supports full view controller containment. The drawer view controllers will properly receive their view appearance methods at the correct time now, including every time they are about to become visible. Please note that `mm_drawerWillApear` has now been deprecated. More notes below. (Kevin Harwood, Lars Anderson)
Expand Down
4 changes: 2 additions & 2 deletions MMDrawerController.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "MMDrawerController"
s.version = "0.1.0"
s.version = "0.3.0"
s.summary = "A lightweight, easy-to-use side drawer navigation controller."
s.homepage = "https://github.com/mutualmobile/MMDrawerController"
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { "Kevin Harwood" => "[email protected]" }
s.source = { :git => "https://github.com/mutualmobile/MMDrawerController.git", :tag => "0.1.0" }
s.source = { :git => "https://github.com/mutualmobile/MMDrawerController.git", :tag => "0.3.0" }
s.platform = :ios, '5.0'
s.requires_arc = true
s.screenshots = [ "http://mutualmobile.github.io/MMDrawerController/ExampleImages/example1.png",
Expand Down
46 changes: 38 additions & 8 deletions MMDrawerController/MMDrawerController.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ typedef NS_OPTIONS(NSInteger, MMOpenDrawerGestureMode) {
MMOpenDrawerGestureModePanningNavigationBar = 1 << 1,
MMOpenDrawerGestureModePanningCenterView = 1 << 2,
MMOpenDrawerGestureModeBezelPanningCenterView = 1 << 3,
MMOpenDrawerGestureModeAll = MMOpenDrawerGestureModePanningNavigationBar |
MMOpenDrawerGestureModePanningCenterView |
MMOpenDrawerGestureModeBezelPanningCenterView,
MMOpenDrawerGestureModeCustom = 1 << 4,
MMOpenDrawerGestureModeAll = MMOpenDrawerGestureModePanningNavigationBar |
MMOpenDrawerGestureModePanningCenterView |
MMOpenDrawerGestureModeBezelPanningCenterView |
MMOpenDrawerGestureModeCustom,
};

typedef NS_OPTIONS(NSInteger, MMCloseDrawerGestureMode) {
Expand All @@ -71,12 +73,14 @@ typedef NS_OPTIONS(NSInteger, MMCloseDrawerGestureMode) {
MMCloseDrawerGestureModeTapNavigationBar = 1 << 4,
MMCloseDrawerGestureModeTapCenterView = 1 << 5,
MMCloseDrawerGestureModePanningDrawerView = 1 << 6,
MMCloseDrawerGestureModeCustom = 1 << 7,
MMCloseDrawerGestureModeAll = MMCloseDrawerGestureModePanningNavigationBar |
MMCloseDrawerGestureModePanningCenterView |
MMCloseDrawerGestureModeBezelPanningCenterView |
MMCloseDrawerGestureModeTapNavigationBar |
MMCloseDrawerGestureModeTapCenterView |
MMCloseDrawerGestureModePanningDrawerView,
MMCloseDrawerGestureModePanningDrawerView |
MMCloseDrawerGestureModeCustom,
};

typedef NS_ENUM(NSInteger, MMDrawerOpenCenterInteractionMode) {
Expand Down Expand Up @@ -200,8 +204,6 @@ typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * dr
/**
Creates and initializes an `MMDrawerController` object with the specified center view controller, left drawer view controller, and right drawer view controller.
This is the designated initializer.
@param centerViewController The center view controller. This argument must not be `nil`.
@param leftDrawerViewController The left drawer view controller.
@param rightDrawerViewController The right drawer controller.
Expand Down Expand Up @@ -279,7 +281,7 @@ typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * dr
@param completion The block called when the animation is finsihed.
*/
-(void)setCenterViewController:(UIViewController *)centerViewController withCloseAnimation:(BOOL)closeAnimated completion:(void(^)(BOOL))completion;
-(void)setCenterViewController:(UIViewController *)centerViewController withCloseAnimation:(BOOL)closeAnimated completion:(void(^)(BOOL finished))completion;

/**
Sets the new `centerViewController`.
Expand All @@ -291,7 +293,7 @@ typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * dr
@param completion The block called when the animation is finsihed.
*/
-(void)setCenterViewController:(UIViewController *)newCenterViewController withFullCloseAnimation:(BOOL)fullCloseAnimated completion:(void(^)(BOOL))completion;
-(void)setCenterViewController:(UIViewController *)newCenterViewController withFullCloseAnimation:(BOOL)fullCloseAnimated completion:(void(^)(BOOL finished))completion;

///---------------------------------------
/// @name Animating the Width of a Drawer
Expand Down Expand Up @@ -363,4 +365,32 @@ typedef void (^MMDrawerControllerDrawerVisualStateBlock)(MMDrawerController * dr
*/
-(void)setDrawerVisualStateBlock:(void(^)(MMDrawerController * drawerController, MMDrawerSide drawerSide, CGFloat percentVisible))drawerVisualStateBlock;

///---------------------------------------
/// @name Gesture Completion Handling
///---------------------------------------

/**
Sets a callback to be called when a gesture has been completed.
This block is called when a gesture action has been completed. You can query the `openSide` of the `drawerController` to determine what the new state of the drawer is.
@param gestureCompletionBlock A block object to be called that allows the implementer be notified when a gesture action has been completed.
*/
-(void)setGestureCompletionBlock:(void(^)(MMDrawerController * drawerController, UIGestureRecognizer * gesture))gestureCompletionBlock;

///---------------------------------------
/// @name Custom Gesture Handler
///---------------------------------------

/**
Sets a callback to be called to determine if a UIGestureRecognizer should recieve the given UITouch.
This block provides a way to allow a gesture to be recognized with custom logic. For example, you may have a certain part of your view that should accept a pan gesture recognizer to open the drawer, but not another a part. If you return YES, the gesture is recognized and the appropriate action is taken. This provides similar support to how Facebook allows you to pan on the background view of the main table view, but not the content itself. You can inspect the `openSide` property of the `drawerController` to determine the current state of the drawer, and apply the appropriate logic within your block.
Note that either `openDrawerGestureModeMask` must contain `MMOpenDrawerGestureModeCustom`, or `closeDrawerGestureModeMask` must contain `MMCloseDrawerGestureModeCustom` for this block to be consulted.
@param gestureShouldRecognizeTouchBlock A block object to be called to determine if the given `touch` should be recognized by the given gesture.
*/
-(void)setGestureShouldRecognizeTouchBlock:(BOOL(^)(MMDrawerController * drawerController, UIGestureRecognizer * gesture, UITouch * touch))gestureShouldRecognizeTouchBlock;

@end
Loading

0 comments on commit 50748cc

Please sign in to comment.