Skip to content

Commit dd8eb13

Browse files
committed
Cleaned up constant usage
1 parent 10e647c commit dd8eb13

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

TORoundedButton/TORoundedButton.m

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ - (void)layoutSubviews {
205205

206206
// Lay out the title label
207207
if (!_titleLabel) { return; }
208-
209208
[_titleLabel sizeToFit];
210209
_titleLabel.center = (CGPoint){
211210
.x = CGRectGetMidX(_contentView.bounds),
@@ -276,7 +275,7 @@ - (UIColor *)_labelBackgroundColor TOROUNDEDBUTTON_OBJC_DIRECT {
276275
if (_isTapped || _isTranslucent) { return [UIColor clearColor]; }
277276

278277
// Return clear if the tint color isn't opaque
279-
BOOL isClear = CGColorGetAlpha(self.tintColor.CGColor) < (1.0f - FLT_EPSILON);
278+
const BOOL isClear = CGColorGetAlpha(self.tintColor.CGColor) < (1.0f - FLT_EPSILON);
280279
return isClear ? [UIColor clearColor] : self.tintColor;
281280
}
282281

@@ -366,7 +365,7 @@ - (void)_setBackgroundColorTappedAnimated:(BOOL)animated TOROUNDEDBUTTON_OBJC_DI
366365
- (void)_setLabelAlphaTappedAnimated:(BOOL)animated TOROUNDEDBUTTON_OBJC_DIRECT {
367366
if (_tappedTextAlpha > 1.0f - FLT_EPSILON) { return; }
368367

369-
CGFloat alpha = _isTapped ? _tappedTextAlpha : 1.0f;
368+
const CGFloat alpha = _isTapped ? _tappedTextAlpha : 1.0f;
370369

371370
// Animate the alpha value of the label
372371
void (^animationBlock)(void) = ^{
@@ -397,7 +396,7 @@ - (void)_setLabelAlphaTappedAnimated:(BOOL)animated TOROUNDEDBUTTON_OBJC_DIRECT
397396
- (void)_setButtonScaledTappedAnimated:(BOOL)animated TOROUNDEDBUTTON_OBJC_DIRECT {
398397
if (_tappedButtonScale < FLT_EPSILON) { return; }
399398

400-
CGFloat scale = _isTapped ? _tappedButtonScale : 1.0f;
399+
const CGFloat scale = _isTapped ? _tappedButtonScale : 1.0f;
401400

402401
// Animate the alpha value of the label
403402
void (^animationBlock)(void) = ^{

0 commit comments

Comments
 (0)