@@ -76,10 +76,10 @@ @interface TYAlertView ()
76
76
#define kButtonSpace 6
77
77
#define KButtonHeight 44
78
78
79
- #define ktextFieldOffset 10000
80
- #define ktextFieldHeight 29
81
- #define ktextFieldEdge 8
82
- #define KtextFieldBorderWidth 0.5
79
+ #define kTextFieldOffset 10000
80
+ #define kTextFieldHeight 29
81
+ #define kTextFieldEdge 8
82
+ #define KTextFieldBorderWidth 0.5
83
83
84
84
85
85
@implementation TYAlertView
@@ -131,14 +131,14 @@ - (void)configureProperty
131
131
_buttonSpace = kButtonSpace ;
132
132
_buttonContentViewEdge = kContentViewEdge ;
133
133
_buttonCornerRadius = 4.0 ;
134
- _buttonFont = [UIFont fontWithName: @" HelveticaNeue" size: 18 ];;
134
+ _buttonFont = [UIFont fontWithName: @" HelveticaNeue" size: 18 ];
135
135
_buttonDefaultBgColor = [UIColor colorWithRed: 52 /255.0 green: 152 /255.0 blue: 219 /255.0 alpha: 1 ];
136
136
_buttonCancelBgColor = [UIColor colorWithRed: 127 /255.0 green: 140 /255.0 blue: 141 /255.0 alpha: 1 ];
137
137
_buttonDestructiveBgColor = [UIColor colorWithRed: 231 /255.0 green: 76 /255.0 blue: 60 /255.0 alpha: 1 ];
138
138
139
- _textFieldHeight = ktextFieldHeight ;
140
- _textFieldEdge = ktextFieldEdge ;
141
- _textFieldorderWidth = KtextFieldBorderWidth ;
139
+ _textFieldHeight = kTextFieldHeight ;
140
+ _textFieldEdge = kTextFieldEdge ;
141
+ _textFieldBorderWidth = KTextFieldBorderWidth ;
142
142
_textFieldContentViewEdge = kContentViewEdge ;
143
143
144
144
_textFieldBorderColor = [UIColor colorWithRed: 203 /255.0 green: 203 /255.0 blue: 203 /255.0 alpha: 1 ];
@@ -240,7 +240,7 @@ - (void)addTextFieldWithConfigurationHandler:(void (^)(UITextField *textField))c
240
240
}
241
241
242
242
UITextField *textField = [[UITextField alloc ]init];
243
- textField.tag = ktextFieldOffset + _textFields.count ;
243
+ textField.tag = kTextFieldOffset + _textFields.count ;
244
244
textField.font = _textFieldFont;
245
245
textField.translatesAutoresizingMaskIntoConstraints = NO ;
246
246
@@ -262,7 +262,7 @@ - (void)addTextFieldWithConfigurationHandler:(void (^)(UITextField *textField))c
262
262
[_textFieldSeparateViews addObject: separateView];
263
263
}
264
264
265
- [self layouttextFields ];
265
+ [self layoutTextFields ];
266
266
}
267
267
268
268
- (NSArray *)textFieldArray
@@ -337,20 +337,20 @@ - (void)layoutButtons
337
337
[_buttonContentView removeConstraintWithView: firstBtn attribute: NSLayoutAttributeRight];
338
338
[_buttonContentView removeConstraintWithView: firstBtn attribute: NSLayoutAttributeBottom];
339
339
[_buttonContentView removeConstraintWithView: secondBtn attribute: NSLayoutAttributeTop];
340
- [_buttonContentView addConstraintWithView: firstBtn topView: nil leftView: nil bottomView: 0 rightView: _buttonContentView edgeInset: UIEdgeInsetsZero];
340
+ [_buttonContentView addConstraintWithView: firstBtn topView: nil leftView: nil bottomView: nil rightView: _buttonContentView edgeInset: UIEdgeInsetsZero];
341
341
[_buttonContentView addConstraintWithTopView: firstBtn toBottomView: secondBtn constant: _buttonSpace];
342
342
343
343
}
344
344
345
- UIButton *lastSecondBtn = _buttons[_buttons.count- 2 ];
345
+ UIButton *lastSecondBtn = _buttons[_buttons.count - 2 ];
346
346
[_buttonContentView removeConstraintWithView: lastSecondBtn attribute: NSLayoutAttributeBottom];
347
347
[_buttonContentView addConstraintWithTopView: lastSecondBtn toBottomView: button constant: _buttonSpace];
348
348
[_buttonContentView addConstraintWithView: button topView: nil leftView: _buttonContentView bottomView: _buttonContentView rightView: _buttonContentView edgeInset: UIEdgeInsetsZero];
349
349
[_buttonContentView addConstraintEqualWithView: button widthToView: nil heightToView: lastSecondBtn];
350
350
}
351
351
}
352
352
353
- - (void )layouttextFields
353
+ - (void )layoutTextFields
354
354
{
355
355
UITextField *textField = _textFields.lastObject ;
356
356
@@ -359,24 +359,24 @@ - (void)layouttextFields
359
359
_textFieldContentView.backgroundColor = _textFieldBackgroudColor;
360
360
_textFieldContentView.layer .masksToBounds = YES ;
361
361
_textFieldContentView.layer .cornerRadius = 4 ;
362
- _textFieldContentView.layer .borderWidth = _textFieldorderWidth ;
362
+ _textFieldContentView.layer .borderWidth = _textFieldBorderWidth ;
363
363
_textFieldContentView.layer .borderColor = _textFieldBorderColor.CGColor ;
364
364
_textFieldTopConstraint.constant = -_contentViewSpace;
365
- [_textFieldContentView addConstraintToView: textField edgeInset: UIEdgeInsetsMake (_textFieldorderWidth , _textFieldEdge, -_textFieldorderWidth , -_textFieldEdge)];
365
+ [_textFieldContentView addConstraintToView: textField edgeInset: UIEdgeInsetsMake (_textFieldBorderWidth , _textFieldEdge, -_textFieldBorderWidth , -_textFieldEdge)];
366
366
[textField addConstraintWidth: 0 height: _textFieldHeight];
367
367
}else {
368
368
// textField
369
- UITextField *lastSecondtextField = _textFields[_textFields.count - 2 ];
370
- [_textFieldContentView removeConstraintWithView: lastSecondtextField attribute: NSLayoutAttributeBottom];
371
- [_textFieldContentView addConstraintWithTopView: lastSecondtextField toBottomView: textField constant: _textFieldorderWidth ];
372
- [_textFieldContentView addConstraintWithView: textField topView: nil leftView: _textFieldContentView bottomView: _textFieldContentView rightView: _textFieldContentView edgeInset: UIEdgeInsetsMake (0 , _textFieldEdge, -_textFieldorderWidth , -_textFieldEdge)];
373
- [_textFieldContentView addConstraintEqualWithView: textField widthToView: nil heightToView: lastSecondtextField ];
369
+ UITextField *lastSecondTextField = _textFields[_textFields.count - 2 ];
370
+ [_textFieldContentView removeConstraintWithView: lastSecondTextField attribute: NSLayoutAttributeBottom];
371
+ [_textFieldContentView addConstraintWithTopView: lastSecondTextField toBottomView: textField constant: _textFieldBorderWidth ];
372
+ [_textFieldContentView addConstraintWithView: textField topView: nil leftView: _textFieldContentView bottomView: _textFieldContentView rightView: _textFieldContentView edgeInset: UIEdgeInsetsMake (0 , _textFieldEdge, -_textFieldBorderWidth , -_textFieldEdge)];
373
+ [_textFieldContentView addConstraintEqualWithView: textField widthToView: nil heightToView: lastSecondTextField ];
374
374
375
375
// separateview
376
376
UIView *separateView = _textFieldSeparateViews[_textFields.count - 2 ];
377
377
[_textFieldContentView addConstraintWithView: separateView topView: nil leftView: _textFieldContentView bottomView: nil rightView: _textFieldContentView edgeInset: UIEdgeInsetsZero];
378
378
[_textFieldContentView addConstraintWithTopView: separateView toBottomView: textField constant: 0 ];
379
- [separateView addConstraintWidth: 0 height: _textFieldorderWidth ];
379
+ [separateView addConstraintWidth: 0 height: _textFieldBorderWidth ];
380
380
}
381
381
}
382
382
0 commit comments