-
Notifications
You must be signed in to change notification settings - Fork 190
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
Resolved pedantic warnings; fixed Retina images #79
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ - (UIView *)subtitleViewOrDefault { | |
|
||
- (SMCalloutBackgroundView *)backgroundView { | ||
// create our default background on first access only if it's nil, since you might have set your own background anyway. | ||
return _backgroundView ?: (_backgroundView = [self defaultBackgroundView]); | ||
return _backgroundView ? _backgroundView : (_backgroundView = [self defaultBackgroundView]); | ||
} | ||
|
||
- (SMCalloutBackgroundView *)defaultBackgroundView { | ||
|
@@ -159,6 +159,9 @@ - (CGFloat)leftAccessoryVerticalMargin { | |
return 0; | ||
} | ||
|
||
#pragma clang diagnostic push | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Instead of this, could you change There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When the compiler is pedantic, it’s really pedantic. The problem is that |
||
#pragma clang diagnostic ignored "-Wgnu-statement-expression" | ||
|
||
- (CGFloat)leftAccessoryHorizontalMargin { | ||
return MIN(self.leftAccessoryVerticalMargin, TITLE_HMARGIN); | ||
} | ||
|
@@ -174,6 +177,8 @@ - (CGFloat)rightAccessoryHorizontalMargin { | |
return MIN(self.rightAccessoryVerticalMargin, TITLE_HMARGIN); | ||
} | ||
|
||
#pragma clang diagnostic pop | ||
|
||
- (CGFloat)innerContentMarginLeft { | ||
if (self.leftAccessoryView) | ||
return self.leftAccessoryHorizontalMargin + self.leftAccessoryView.frameWidth + TITLE_HMARGIN; | ||
|
@@ -250,7 +255,7 @@ - (CGSize)offsetToContainRect:(CGRect)innerRect inRect:(CGRect)outerRect { | |
CGFloat nudgeLeft = fminf(0, CGRectGetMaxX(outerRect) - CGRectGetMaxX(innerRect)); | ||
CGFloat nudgeTop = fmaxf(0, CGRectGetMinY(outerRect) - CGRectGetMinY(innerRect)); | ||
CGFloat nudgeBottom = fminf(0, CGRectGetMaxY(outerRect) - CGRectGetMaxY(innerRect)); | ||
return CGSizeMake(nudgeLeft ?: nudgeRight, nudgeTop ?: nudgeBottom); | ||
return CGSizeMake(nudgeLeft ? nudgeLeft : nudgeRight, nudgeTop ? nudgeTop : nudgeBottom); | ||
} | ||
|
||
- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToView:(UIView *)constrainedView animated:(BOOL)animated { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting; the
?:
operator causes a warning?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep just reproduced it. That sucks, I love that operator! Oh well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do too… :-\