Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Xcode 9 warning warning by declaring block argument as type void #133

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
@see pushViewController:onDirection:animated:forceToPopPush:completion:
@see pushOldViewControllerOnDirection:animated:completion:
*/
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)())completionBlock;
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)(void))completionBlock;

/**
Same as below, but without completionBlock for backward compatibility
Expand All @@ -294,7 +294,7 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
For example, you could push a new left controller from the left. In this case, setting forcePopPush to YES will pop to center view controller, then push the new controller.
@see pushViewController:onDirection:withOffset:animated:forceToPopPush:
*/
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction animated:(BOOL)animated forceToPopPush:(BOOL)forcePopPush completion:(void (^)())completionBlock;
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction animated:(BOOL)animated forceToPopPush:(BOOL)forcePopPush completion:(void (^)(void))completionBlock;

/**
Same as below, but without completionBlock for backward compatibility
Expand All @@ -310,7 +310,7 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
@param animated Animated or not
@param completionBlock Block that would be called after animation completed
*/
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)())completionBlock;
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)(void))completionBlock;

/**
Same as below, but without completionBlock for backward compatibility
Expand All @@ -328,7 +328,7 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
@param completionBlock Block that would be called after animation completed
For example, you could push a new left controller from the left. In this case, setting forcePopPush to YES will pop to center view controller, then push the new controller.
*/
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated forceToPopPush:(BOOL)forcePopPush completion:(void (^)())completionBlock;
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated forceToPopPush:(BOOL)forcePopPush completion:(void (^)(void))completionBlock;

/**
Same as below, but without completionBlock for backward compatibility
Expand All @@ -344,7 +344,7 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
@param completionBlock Block that would be called after animation completed
@see pushOldViewControllerOnDirection:withOffset:animated:
*/
- (void)pushOldViewControllerOnDirection:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)())completionBlock;
- (void)pushOldViewControllerOnDirection:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)(void))completionBlock;

/**
Same as below, but without completionBlock for backward compatibility
Expand All @@ -359,7 +359,7 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
@param animated Animated or not
@param completionBlock Block that would be called after animation completed
*/
- (void)pushOldViewControllerOnDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)())completionBlock;
- (void)pushOldViewControllerOnDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)(void))completionBlock;

/**
Same as below, but without completionBlock for backward compatibility
Expand All @@ -374,7 +374,7 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
@param completionBlock Block that would be called after animation completed
@see popViewControllerAnimated:
*/
- (void)popViewControllerWithNewCenterController:(UIViewController *)centerController animated:(BOOL)animated completion:(void (^)())completionBlock;
- (void)popViewControllerWithNewCenterController:(UIViewController *)centerController animated:(BOOL)animated completion:(void (^)(void))completionBlock;

/**
Same as below, but without completionBlock for backward compatibility
Expand All @@ -388,7 +388,7 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
@param completionBlock Block that would be called after animation completed
@see popViewControllerWithNewCenterController:animated:
*/
- (void)popViewControllerAnimated:(BOOL)animated completion:(void (^)())completionBlock;
- (void)popViewControllerAnimated:(BOOL)animated completion:(void (^)(void))completionBlock;

/**
Same as below, but without completionBlock for backward compatibility
Expand All @@ -402,7 +402,7 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
@param animated Animated or not
@param completionBlock Block that would be called after animation completed
*/
- (void)openCompletelySide:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)())completionBlock;
- (void)openCompletelySide:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)(void))completionBlock;

/**
Same as below, but without completionBlock for backward compatibility
Expand All @@ -416,7 +416,7 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
@param completionBlock Block that would be called after animation completed
@see openCompletelySide:animated:
*/
- (void)openCompletelyAnimated:(BOOL)animated completion:(void (^)())completionBlock;
- (void)openCompletelyAnimated:(BOOL)animated completion:(void (^)(void))completionBlock;

/**
Same as below, but without completionBlock for backward compatibility
Expand All @@ -430,7 +430,7 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
@param completionBlock Block that would be called after animation completed
@see replaceAfterOpenedCompletelyWithOffset:animated:
*/
- (void)replaceAfterOpenedCompletelyAnimated:(BOOL)animated completion:(void (^)())completionBlock;
- (void)replaceAfterOpenedCompletelyAnimated:(BOOL)animated completion:(void (^)(void))completionBlock;

/**
Same as below, but without completionBlock for backward compatibility
Expand All @@ -445,15 +445,15 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
@param animated Animated or not
@param completionBlock Block that would be called after animation completed
*/
- (void)replaceAfterOpenedCompletelyWithOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)())completionBlock;
- (void)replaceAfterOpenedCompletelyWithOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)(void))completionBlock;

/**
Replace the central view with complete opening animation. This is useful if you use side view as menu and need to switch central view after some operation without using the menu.
@param newCenterController A new controller for central view
@param animated Animated or not
@param completionBlock Block that would be called after animation completed
*/
- (void)replaceCentralViewControllerWithNewController:(UIViewController *)newCenterController animated:(BOOL)animated animationDirection:(PPRevealSideDirection)direction completion:(void (^)())completionBlock;
- (void)replaceCentralViewControllerWithNewController:(UIViewController *)newCenterController animated:(BOOL)animated animationDirection:(PPRevealSideDirection)direction completion:(void (^)(void))completionBlock;

/**
Replace the central view without any animation. That way, if the user switches center controller from the menu, it won't pop to place the new center controller on complete screen
Expand Down Expand Up @@ -681,4 +681,4 @@ typedef NS_OPTIONS(NSUInteger,PPRevealSideOptions) {
*/
- (void) pprevealSideViewController:(PPRevealSideViewController*)controller didManuallyMoveCenterControllerWithOffset:(CGFloat)offset;

@end
@end
Original file line number Diff line number Diff line change
Expand Up @@ -136,31 +136,31 @@ - (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealS
[self pushViewController:controller onDirection:direction animated:animated completion:nil];
}

- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)())completionBlock {
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)(void))completionBlock {
[self pushViewController:controller onDirection:direction withOffset:DefaultOffset animated:animated completion:completionBlock];
}

- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction animated:(BOOL)animated forceToPopPush:(BOOL)forcePopPush {
[self pushViewController:controller onDirection:direction animated:animated forceToPopPush:forcePopPush completion:nil];
}

- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction animated:(BOOL)animated forceToPopPush:(BOOL)forcePopPush completion:(void (^)())completionBlock {
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction animated:(BOOL)animated forceToPopPush:(BOOL)forcePopPush completion:(void (^)(void))completionBlock {
[self pushViewController:controller onDirection:direction withOffset:DefaultOffset animated:animated forceToPopPush:forcePopPush completion:completionBlock];
}

- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated {
[self pushViewController:controller onDirection:direction withOffset:offset animated:animated completion:nil];
}

- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)())completionBlock {
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)(void))completionBlock {
[self pushViewController:controller onDirection:direction withOffset:offset animated:animated forceToPopPush:NO completion:completionBlock];
}

- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated forceToPopPush:(BOOL)forcePopPush {
[self pushViewController:controller onDirection:direction withOffset:offset animated:animated forceToPopPush:forcePopPush completion:nil];
}

- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated forceToPopPush:(BOOL)forcePopPush completion:(void (^)())completionBlock {
- (void)pushViewController:(UIViewController *)controller onDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated forceToPopPush:(BOOL)forcePopPush completion:(void (^)(void))completionBlock {
if (_animationInProgress) return;

_rootViewController.view.alpha = 1.0f;
Expand Down Expand Up @@ -304,15 +304,15 @@ - (void)pushOldViewControllerOnDirection:(PPRevealSideDirection)direction animat
[self pushOldViewControllerOnDirection:direction animated:animated completion:nil];
}

- (void)pushOldViewControllerOnDirection:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)())completionBlock {
- (void)pushOldViewControllerOnDirection:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)(void))completionBlock {
[self pushOldViewControllerOnDirection:direction withOffset:DefaultOffset animated:animated completion:completionBlock];
}

- (void)pushOldViewControllerOnDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated {
[self pushOldViewControllerOnDirection:direction withOffset:offset animated:animated completion:nil];
}

- (void)pushOldViewControllerOnDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)())completionBlock {
- (void)pushOldViewControllerOnDirection:(PPRevealSideDirection)direction withOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)(void))completionBlock {
UIViewController *oldController = _viewControllers[@(direction)];
if (oldController) {
[self pushViewController:oldController onDirection:direction withOffset:offset animated:animated forceToPopPush:NO completion:completionBlock];
Expand Down Expand Up @@ -351,23 +351,23 @@ - (void)popViewControllerAnimated:(BOOL)animated {
[self popViewControllerAnimated:animated completion:nil];
}

- (void)popViewControllerAnimated:(BOOL)animated completion:(void (^)())completionBlock {
- (void)popViewControllerAnimated:(BOOL)animated completion:(void (^)(void))completionBlock {
[self popViewControllerWithNewCenterController:_rootViewController animated:animated completion:completionBlock];
}

- (void)popViewControllerWithNewCenterController:(UIViewController *)centerController animated:(BOOL)animated {
[self popViewControllerWithNewCenterController:centerController animated:animated completion:nil];
}

- (void)popViewControllerWithNewCenterController:(UIViewController *)centerController animated:(BOOL)animated completion:(void (^)())completionBlock {
- (void)popViewControllerWithNewCenterController:(UIViewController *)centerController animated:(BOOL)animated completion:(void (^)(void))completionBlock {
[self popViewControllerWithNewCenterController:centerController animated:animated andPresentNewController:nil withDirection:PPRevealSideDirectionNone andOffset:0.0f completion:completionBlock];
}

- (void)popViewControllerWithNewCenterController:(UIViewController *)centerController animated:(BOOL)animated andPresentNewController:(UIViewController *)controllerToPush withDirection:(PPRevealSideDirection)direction andOffset:(CGFloat)offset {
[self popViewControllerWithNewCenterController:centerController animated:animated andPresentNewController:controllerToPush withDirection:direction andOffset:offset completion:nil];
}

- (void)popViewControllerWithNewCenterController:(UIViewController *)centerController animated:(BOOL)animated andPresentNewController:(UIViewController *)controllerToPush withDirection:(PPRevealSideDirection)direction andOffset:(CGFloat)offset completion:(void (^)())completionBlock {
- (void)popViewControllerWithNewCenterController:(UIViewController *)centerController animated:(BOOL)animated andPresentNewController:(UIViewController *)controllerToPush withDirection:(PPRevealSideDirection)direction andOffset:(CGFloat)offset completion:(void (^)(void))completionBlock {
if (_animationInProgress) return;

_rootViewController.view.alpha = 1.0f;
Expand Down Expand Up @@ -472,7 +472,7 @@ - (void)openCompletelySide:(PPRevealSideDirection)direction animated:(BOOL)anima
[self openCompletelySide:direction animated:animated completion:nil];
}

- (void)openCompletelySide:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)())completionBlock {
- (void)openCompletelySide:(PPRevealSideDirection)direction animated:(BOOL)animated completion:(void (^)(void))completionBlock {
_shouldNotCloseWhenPushingSameDirection = YES;
[self pushOldViewControllerOnDirection:direction withOffset:0.0f animated:YES completion:completionBlock];
_shouldNotCloseWhenPushingSameDirection = NO;
Expand All @@ -482,7 +482,7 @@ - (void)openCompletelyAnimated:(BOOL)animated {
[self openCompletelyAnimated:animated completion:nil];
}

- (void)openCompletelyAnimated:(BOOL)animated completion:(void (^)())completionBlock {
- (void)openCompletelyAnimated:(BOOL)animated completion:(void (^)(void))completionBlock {
PPRevealSideDirection direction = [self getSideToClose];
[self openCompletelySide:direction animated:animated completion:completionBlock];
}
Expand All @@ -492,22 +492,22 @@ - (void)replaceAfterOpenedCompletelyAnimated:(BOOL)animated {
[self replaceAfterOpenedCompletelyAnimated:animated completion:nil];
}

- (void)replaceAfterOpenedCompletelyAnimated:(BOOL)animated completion:(void (^)())completionBlock {
- (void)replaceAfterOpenedCompletelyAnimated:(BOOL)animated completion:(void (^)(void))completionBlock {
[self replaceAfterOpenedCompletelyWithOffset:DefaultOffset animated:animated completion:completionBlock];
}

- (void)replaceAfterOpenedCompletelyWithOffset:(CGFloat)offset animated:(BOOL)animated {
[self replaceAfterOpenedCompletelyWithOffset:offset animated:animated completion:nil];
}

- (void)replaceAfterOpenedCompletelyWithOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)())completionBlock {
- (void)replaceAfterOpenedCompletelyWithOffset:(CGFloat)offset animated:(BOOL)animated completion:(void (^)(void))completionBlock {
_shouldNotCloseWhenPushingSameDirection = YES;
PPRevealSideDirection direction = [self getSideToClose];
[self pushOldViewControllerOnDirection:direction withOffset:offset animated:animated completion:completionBlock];
_shouldNotCloseWhenPushingSameDirection = NO;
}

- (void)replaceCentralViewControllerWithNewController:(UIViewController *)newCenterController animated:(BOOL)animated animationDirection:(PPRevealSideDirection)direction completion:(void (^)())completionBlock {
- (void)replaceCentralViewControllerWithNewController:(UIViewController *)newCenterController animated:(BOOL)animated animationDirection:(PPRevealSideDirection)direction completion:(void (^)(void))completionBlock {
__block __typeof(&*self) weakSelf = self;
[self openCompletelySide:direction animated:animated completion:^{
[weakSelf popViewControllerWithNewCenterController:newCenterController animated:animated completion:completionBlock];
Expand Down