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