Skip to content

Commit fe3ff2f

Browse files
author
Diogo Autilio
committed
Remove useless variable
1 parent 2475070 commit fe3ff2f

1 file changed

Lines changed: 14 additions & 16 deletions

File tree

SCLAlertView/SCLAlertView.m

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ @interface SCLAlertView () <UITextFieldDelegate>
5151
@property (nonatomic) CGFloat windowHeight;
5252
@property (nonatomic) CGFloat windowWidth;
5353
@property (nonatomic) CGFloat circleIconHeight;
54-
@property (nonatomic) CGFloat textHeight;
5554
@property (nonatomic) CGFloat subTitleHeight;
5655

5756
@end
@@ -88,7 +87,6 @@ - (instancetype)init
8887
kCircleHeightBackground = 62.0f;
8988
kActivityIndicatorHeight = 40.0f;
9089
self.subTitleHeight = 90.0f;
91-
self.textHeight = 90.0f;
9290
self.circleIconHeight = 20.0f;
9391
self.windowWidth = 240.0f;
9492
self.windowHeight = 178.0f;
@@ -151,7 +149,7 @@ - (instancetype)init
151149
_viewText.allowsEditingTextAttributes = YES;
152150
_viewText.textAlignment = NSTextAlignmentCenter;
153151
_viewText.font = [UIFont fontWithName:_bodyTextFontFamily size:_bodyFontSize];
154-
_viewText.frame = CGRectMake(12.0f, 70.0f, _windowWidth - 24.0f, _textHeight);
152+
_viewText.frame = CGRectMake(12.0f, 70.0f, _windowWidth - 24.0f, _subTitleHeight);
155153

156154
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
157155
{
@@ -249,7 +247,7 @@ - (void)viewWillLayoutSubviews
249247

250248
// Text fields
251249
CGFloat y = (_labelTitle.text == nil) ? (kCircleHeight - 20.0f) : 74.0f;
252-
y += _textHeight + 14.0f;
250+
y += _subTitleHeight + 14.0f;
253251
for (UITextField *textField in _inputs)
254252
{
255253
textField.frame = CGRectMake(12.0f, y, _windowWidth - 24.0f, 30.0f);
@@ -584,7 +582,7 @@ -(SCLAlertViewResponder *)showTitle:(UIViewController *)vc image:(UIImage *)imag
584582
[_labelTitle removeFromSuperview];
585583

586584
// Move up
587-
_viewText.frame = CGRectMake(12.0f, kCircleHeight - 20, _windowWidth - 24.0f, _textHeight);
585+
_viewText.frame = CGRectMake(12.0f, kCircleHeight - 20, _windowWidth - 24.0f, _subTitleHeight);
588586
}
589587

590588
// Subtitle
@@ -610,34 +608,34 @@ -(SCLAlertViewResponder *)showTitle:(UIViewController *)vc image:(UIImage *)imag
610608
NSString *str = subTitle;
611609
CGRect r = [str boundingRectWithSize:sz options:NSStringDrawingUsesLineFragmentOrigin attributes:attr context:nil];
612610
CGFloat ht = ceil(r.size.height);
613-
if (ht < _textHeight)
611+
if (ht < _subTitleHeight)
614612
{
615-
self.windowHeight -= (_textHeight - ht);
616-
self.textHeight = ht;
613+
self.windowHeight -= (_subTitleHeight - ht);
614+
self.subTitleHeight = ht;
617615
}else{
618-
self.windowHeight += (ht - _textHeight);
619-
self.textHeight = ht;
616+
self.windowHeight += (ht - _subTitleHeight);
617+
self.subTitleHeight = ht;
620618
}
621619
}
622620
else
623621
{
624622
NSAttributedString *str =[[NSAttributedString alloc] initWithString:subTitle attributes:attr];
625623
CGRect r = [str boundingRectWithSize:sz options:NSStringDrawingUsesLineFragmentOrigin context:nil];
626624
CGFloat ht = ceil(r.size.height) + 10.0f;
627-
if (ht < _textHeight)
625+
if (ht < _subTitleHeight)
628626
{
629-
self.windowHeight -= (_textHeight - ht);
630-
self.textHeight = ht;
627+
self.windowHeight -= (_subTitleHeight - ht);
628+
self.subTitleHeight = ht;
631629
}else{
632-
self.windowHeight += (ht - _textHeight);
633-
self.textHeight = ht;
630+
self.windowHeight += (ht - _subTitleHeight);
631+
self.subTitleHeight = ht;
634632
}
635633
}
636634
}
637635
else
638636
{
639637
// Subtitle is nil, we can move the title to center and remove it from superView
640-
self.textHeight = 0.0f;
638+
self.subTitleHeight = 0.0f;
641639
self.windowHeight -= _viewText.frame.size.height;
642640
[_viewText removeFromSuperview];
643641

0 commit comments

Comments
 (0)