From f8b57dd5ec58faaad5bd7bf697b382f06f885157 Mon Sep 17 00:00:00 2001 From: Joao Nunes Date: Wed, 14 Aug 2013 13:48:54 +0300 Subject: [PATCH 1/2] Added variable names to block declarations to help in code completion --- MMDrawerController/MMDrawerController.m | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/MMDrawerController/MMDrawerController.m b/MMDrawerController/MMDrawerController.m index e4102918..629469eb 100644 --- a/MMDrawerController/MMDrawerController.m +++ b/MMDrawerController/MMDrawerController.m @@ -171,7 +171,7 @@ -(id)initWithCenterViewController:(UIViewController *)centerViewController right } #pragma mark - Open/Close methods --(void)toggleDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void (^)(BOOL))completion{ +-(void)toggleDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void (^)(BOOL finished))completion{ NSParameterAssert(drawerSide!=MMDrawerSideNone); if(self.openSide == MMDrawerSideNone){ [self openDrawerSide:drawerSide animated:animated completion:completion]; @@ -189,11 +189,11 @@ -(void)toggleDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated complet } } --(void)closeDrawerAnimated:(BOOL)animated completion:(void (^)(BOOL))completion{ +-(void)closeDrawerAnimated:(BOOL)animated completion:(void (^)(BOOL finished))completion{ [self closeDrawerAnimated:animated velocity:self.animationVelocity animationOptions:UIViewAnimationOptionCurveEaseInOut completion:completion]; } --(void)closeDrawerAnimated:(BOOL)animated velocity:(CGFloat)velocity animationOptions:(UIViewAnimationOptions)options completion:(void (^)(BOOL))completion{ +-(void)closeDrawerAnimated:(BOOL)animated velocity:(CGFloat)velocity animationOptions:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion{ if (self.isAnimatingDrawer) { if(completion){ completion(NO); @@ -249,13 +249,13 @@ -(void)closeDrawerAnimated:(BOOL)animated velocity:(CGFloat)velocity animationOp } } --(void)openDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void (^)(BOOL))completion{ +-(void)openDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated completion:(void (^)(BOOL finished))completion{ NSParameterAssert(drawerSide != MMDrawerSideNone); [self openDrawerSide:drawerSide animated:animated velocity:self.animationVelocity animationOptions:UIViewAnimationOptionCurveEaseInOut completion:completion]; } --(void)openDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated velocity:(CGFloat)velocity animationOptions:(UIViewAnimationOptions)options completion:(void (^)(BOOL))completion{ +-(void)openDrawerSide:(MMDrawerSide)drawerSide animated:(BOOL)animated velocity:(CGFloat)velocity animationOptions:(UIViewAnimationOptions)options completion:(void (^)(BOOL finished))completion{ NSParameterAssert(drawerSide != MMDrawerSideNone); if(self.isAnimatingDrawer){ if(completion){ @@ -351,7 +351,7 @@ -(void)setCenterViewController:(UIViewController *)centerViewController animated } } --(void)setCenterViewController:(UIViewController *)newCenterViewController withCloseAnimation:(BOOL)animated completion:(void(^)(BOOL))completion{ +-(void)setCenterViewController:(UIViewController *)newCenterViewController withCloseAnimation:(BOOL)animated completion:(void(^)(BOOL finished))completion{ [self setCenterViewController:newCenterViewController animated:animated]; if(self.openSide != MMDrawerSideNone){ @@ -377,7 +377,7 @@ -(void)setCenterViewController:(UIViewController *)newCenterViewController withC } } --(void)setCenterViewController:(UIViewController *)newCenterViewController withFullCloseAnimation:(BOOL)animated completion:(void(^)(BOOL))completion{ +-(void)setCenterViewController:(UIViewController *)newCenterViewController withFullCloseAnimation:(BOOL)animated completion:(void(^)(BOOL finished))completion{ if(self.openSide != MMDrawerSideNone && animated){ From d31adaf966a32cb1bd8a10820b6f16cc0a029776 Mon Sep 17 00:00:00 2001 From: Kevin Harwood Date: Wed, 14 Aug 2013 11:06:33 -0500 Subject: [PATCH 2/2] Updated Header to have named block variables. --- MMDrawerController/MMDrawerController.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MMDrawerController/MMDrawerController.h b/MMDrawerController/MMDrawerController.h index 4369829d..5d06d7b2 100644 --- a/MMDrawerController/MMDrawerController.h +++ b/MMDrawerController/MMDrawerController.h @@ -281,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`. @@ -293,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