Skip to content

Commit

Permalink
XCode 6.3.1 warnings fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Joan Lluch committed Apr 22, 2015
1 parent b2f3d53 commit c52a327
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
5E605B9C14A081F900853025 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0500;
LastUpgradeCheck = 0630;
};
buildConfigurationList = 5E605B9F14A081F900853025 /* Build configuration list for PBXProject "RevealControllerProject" */;
compatibilityVersion = "Xcode 3.2";
Expand Down Expand Up @@ -337,11 +337,14 @@
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand All @@ -356,7 +359,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
ONLY_ACTIVE_ARCH = YES;
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
Expand All @@ -374,10 +377,13 @@
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "";
COPY_PHASE_STRIP = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
Expand All @@ -386,7 +392,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
PROVISIONING_PROFILE = "";
SDKROOT = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ - (void)viewDidLoad
[revealController tapGestureRecognizer];

UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"]
style:UIBarButtonItemStyleBordered target:revealController action:@selector(revealToggle:)];
style:UIBarButtonItemStylePlain target:revealController action:@selector(revealToggle:)];

self.navigationItem.leftBarButtonItem = revealButtonItem;

UIBarButtonItem *rightRevealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"]
style:UIBarButtonItemStyleBordered target:revealController action:@selector(rightRevealToggle:)];
style:UIBarButtonItemStylePlain target:revealController action:@selector(rightRevealToggle:)];

self.navigationItem.rightBarButtonItem = rightRevealButtonItem;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ - (void)viewDidLoad
//[self.navigationController.navigationBar addGestureRecognizer:revealController.panGestureRecognizer];

UIBarButtonItem *revealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"]
style:UIBarButtonItemStyleBordered target:revealController action:@selector(revealToggle:)];
style:UIBarButtonItemStylePlain target:revealController action:@selector(revealToggle:)];

self.navigationItem.leftBarButtonItem = revealButtonItem;

UIBarButtonItem *rightRevealButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"reveal-icon.png"]
style:UIBarButtonItemStyleBordered target:revealController action:@selector(rightRevealToggle:)];
style:UIBarButtonItemStylePlain target:revealController action:@selector(rightRevealToggle:)];

self.navigationItem.rightBarButtonItem = rightRevealButtonItem;
}
Expand Down
19 changes: 13 additions & 6 deletions SWRevealViewController/SWRevealViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -407,12 +407,19 @@ - (BOOL)isInteractive
return NO; // not supported
}


- (BOOL)transitionWasCancelled
{
return NO; // not supported
}


- (CGAffineTransform)targetTransform
{
return CGAffineTransformIdentity;
}


- (UIModalPresentationStyle)presentationStyle
{
return UIModalPresentationNone; // not applicable
Expand Down Expand Up @@ -561,13 +568,13 @@ - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
if ( _dragging || self.state == UIGestureRecognizerStateFailed)
return;

const int kDirectionPanThreshold = 5;
const CGFloat kDirectionPanThreshold = 5;

UITouch *touch = [touches anyObject];
CGPoint nowPoint = [touch locationInView:self.view];

if (abs(nowPoint.x - _beginPoint.x) > kDirectionPanThreshold) _dragging = YES;
else if (abs(nowPoint.y - _beginPoint.y) > kDirectionPanThreshold) self.state = UIGestureRecognizerStateFailed;
if (ABS(nowPoint.x - _beginPoint.x) > kDirectionPanThreshold) _dragging = YES;
else if (ABS(nowPoint.y - _beginPoint.y) > kDirectionPanThreshold) self.state = UIGestureRecognizerStateFailed;
}

@end
Expand Down Expand Up @@ -1286,7 +1293,7 @@ - (void)_handleRevealGestureStateEndedWithRecognizer:(UIPanGestureRecognizer *)r
NSTimeInterval duration = _toggleAnimationDuration;

// Velocity driven change:
if (fabsf(velocity) > _quickFlickVelocity)
if (ABS(velocity) > _quickFlickVelocity)
{
// we may need to set the drag position and to adjust the animation duration
CGFloat journey = xLocation;
Expand All @@ -1304,7 +1311,7 @@ - (void)_handleRevealGestureStateEndedWithRecognizer:(UIPanGestureRecognizer *)r
}
}

duration = fabsf(journey/velocity);
duration = ABS(journey/velocity);
}

// Position driven change:
Expand Down Expand Up @@ -1361,7 +1368,7 @@ - (void)_dispatchPushFrontViewController:(UIViewController *)newFrontViewControl

NSTimeInterval duration = animated?_toggleAnimationDuration:0.0;
NSTimeInterval firstDuration = duration;
int initialPosDif = abs( _frontViewPosition - preReplacementPosition );
NSInteger initialPosDif = ABS( _frontViewPosition - preReplacementPosition );
if ( initialPosDif == 1 ) firstDuration *= 0.8;
else if ( initialPosDif == 0 ) firstDuration = 0;

Expand Down

0 comments on commit c52a327

Please sign in to comment.