@@ -279,26 +279,26 @@ - (void)layoutContentViews
279
279
return ;
280
280
}
281
281
if (_alertViewWidth) {
282
- [self addConstarintWidth : _alertViewWidth height: 0 ];
282
+ [self addConstraintWidth : _alertViewWidth height: 0 ];
283
283
}
284
284
285
285
// textContentView
286
286
_textContentView.translatesAutoresizingMaskIntoConstraints = NO ;
287
287
288
- [self addConstarintWithView : _textContentView topView: self leftView: self bottomView: nil rightView: self edageInset :UIEdgeInsetsMake (_contentViewSpace, _textLabelContentViewEdge, 0 , -_textLabelContentViewEdge)];
288
+ [self addConstraintWithView : _textContentView topView: self leftView: self bottomView: nil rightView: self edgeInset :UIEdgeInsetsMake (_contentViewSpace, _textLabelContentViewEdge, 0 , -_textLabelContentViewEdge)];
289
289
290
290
// textFieldContentView
291
291
_textFieldContentView.translatesAutoresizingMaskIntoConstraints = NO ;
292
- _textFieldTopConstraint = [self addConstarintWithTopView : _textContentView toBottomView: _textFieldContentView constarint :0 ];
292
+ _textFieldTopConstraint = [self addConstraintWithTopView : _textContentView toBottomView: _textFieldContentView constant :0 ];
293
293
294
- [self addConstarintWithView : _textFieldContentView topView: nil leftView: self bottomView: nil rightView: self edageInset :UIEdgeInsetsMake (0 , _textFieldContentViewEdge, 0 , -_textFieldContentViewEdge)];
294
+ [self addConstraintWithView : _textFieldContentView topView: nil leftView: self bottomView: nil rightView: self edgeInset :UIEdgeInsetsMake (0 , _textFieldContentViewEdge, 0 , -_textFieldContentViewEdge)];
295
295
296
296
// buttonContentView
297
297
_buttonContentView.translatesAutoresizingMaskIntoConstraints = NO ;
298
298
299
- _buttonTopConstraint = [self addConstarintWithTopView : _textFieldContentView toBottomView: _buttonContentView constarint :0 ];
299
+ _buttonTopConstraint = [self addConstraintWithTopView : _textFieldContentView toBottomView: _buttonContentView constant :0 ];
300
300
301
- [self addConstarintWithView : _buttonContentView topView: nil leftView: self bottomView: self rightView: self edageInset :UIEdgeInsetsMake (0 , _buttonContentViewEdge, -_contentViewSpace, -_buttonContentViewEdge)];
301
+ [self addConstraintWithView : _buttonContentView topView: nil leftView: self bottomView: self rightView: self edgeInset :UIEdgeInsetsMake (0 , _buttonContentViewEdge, -_contentViewSpace, -_buttonContentViewEdge)];
302
302
}
303
303
304
304
- (void )layoutTextLabels
@@ -309,44 +309,44 @@ - (void)layoutTextLabels
309
309
}
310
310
// title
311
311
_titleLable.translatesAutoresizingMaskIntoConstraints = NO ;
312
- [_textContentView addConstarintWithView : _titleLable topView: _textContentView leftView: _textContentView bottomView: nil rightView: _textContentView edageInset : UIEdgeInsetsZero];
312
+ [_textContentView addConstraintWithView : _titleLable topView: _textContentView leftView: _textContentView bottomView: nil rightView: _textContentView edgeInset : UIEdgeInsetsZero];
313
313
314
314
// message
315
315
_messageLabel.translatesAutoresizingMaskIntoConstraints = NO ;
316
- [_textContentView addConstarintWithTopView : _titleLable toBottomView: _messageLabel constarint : _textLabelSpace];
317
- [_textContentView addConstarintWithView : _messageLabel topView: nil leftView: _textContentView bottomView: _textContentView rightView: _textContentView edageInset : UIEdgeInsetsZero];
316
+ [_textContentView addConstraintWithTopView : _titleLable toBottomView: _messageLabel constant : _textLabelSpace];
317
+ [_textContentView addConstraintWithView : _messageLabel topView: nil leftView: _textContentView bottomView: _textContentView rightView: _textContentView edgeInset : UIEdgeInsetsZero];
318
318
}
319
319
320
320
- (void )layoutButtons
321
321
{
322
322
UIButton *button = _buttons.lastObject ;
323
323
if (_buttons.count == 1 ) {
324
324
_buttonTopConstraint.constant = -_contentViewSpace;
325
- [_buttonContentView addConstraintToView: button edageInset : UIEdgeInsetsZero];
326
- [button addConstarintWidth :0 height: _buttonHeight];
325
+ [_buttonContentView addConstraintToView: button edgeInset : UIEdgeInsetsZero];
326
+ [button addConstraintWidth :0 height: _buttonHeight];
327
327
}else if (_buttons.count == 2 ) {
328
328
UIButton *firstButton = _buttons.firstObject ;
329
- [_buttonContentView removeConstraintWithView: firstButton attribte : NSLayoutAttributeRight];
330
- [_buttonContentView addConstarintWithView : button topView: _buttonContentView leftView: nil bottomView: nil rightView: _buttonContentView edageInset : UIEdgeInsetsZero];
331
- [_buttonContentView addConstarintWithLeftView : firstButton toRightView: button constarint : _buttonSpace];
332
- [_buttonContentView addConstarintEqualWithView : button widthToView: firstButton heightToView: firstButton];
329
+ [_buttonContentView removeConstraintWithView: firstButton attribute : NSLayoutAttributeRight];
330
+ [_buttonContentView addConstraintWithView : button topView: _buttonContentView leftView: nil bottomView: nil rightView: _buttonContentView edgeInset : UIEdgeInsetsZero];
331
+ [_buttonContentView addConstraintWithLeftView : firstButton toRightView: button constant : _buttonSpace];
332
+ [_buttonContentView addConstraintEqualWithView : button widthToView: firstButton heightToView: firstButton];
333
333
}else {
334
334
if (_buttons.count == 3 ) {
335
335
UIButton *firstBtn = _buttons[0 ];
336
336
UIButton *secondBtn = _buttons[1 ];
337
- [_buttonContentView removeConstraintWithView: firstBtn attribte : NSLayoutAttributeRight];
338
- [_buttonContentView removeConstraintWithView: firstBtn attribte : NSLayoutAttributeBottom];
339
- [_buttonContentView removeConstraintWithView: secondBtn attribte : NSLayoutAttributeTop];
340
- [_buttonContentView addConstarintWithView : firstBtn topView: nil leftView: nil bottomView: 0 rightView: _buttonContentView edageInset : UIEdgeInsetsZero];
341
- [_buttonContentView addConstarintWithTopView : firstBtn toBottomView: secondBtn constarint : _buttonSpace];
337
+ [_buttonContentView removeConstraintWithView: firstBtn attribute : NSLayoutAttributeRight];
338
+ [_buttonContentView removeConstraintWithView: firstBtn attribute : NSLayoutAttributeBottom];
339
+ [_buttonContentView removeConstraintWithView: secondBtn attribute : NSLayoutAttributeTop];
340
+ [_buttonContentView addConstraintWithView : firstBtn topView: nil leftView: nil bottomView: 0 rightView: _buttonContentView edgeInset : UIEdgeInsetsZero];
341
+ [_buttonContentView addConstraintWithTopView : firstBtn toBottomView: secondBtn constant : _buttonSpace];
342
342
343
343
}
344
344
345
345
UIButton *lastSecondBtn = _buttons[_buttons.count-2 ];
346
- [_buttonContentView removeConstraintWithView: lastSecondBtn attribte : NSLayoutAttributeBottom];
347
- [_buttonContentView addConstarintWithTopView : lastSecondBtn toBottomView: button constarint : _buttonSpace];
348
- [_buttonContentView addConstarintWithView : button topView: nil leftView: _buttonContentView bottomView: _buttonContentView rightView: _buttonContentView edageInset : UIEdgeInsetsZero];
349
- [_buttonContentView addConstarintEqualWithView : button widthToView: nil heightToView: lastSecondBtn];
346
+ [_buttonContentView removeConstraintWithView: lastSecondBtn attribute : NSLayoutAttributeBottom];
347
+ [_buttonContentView addConstraintWithTopView : lastSecondBtn toBottomView: button constant : _buttonSpace];
348
+ [_buttonContentView addConstraintWithView : button topView: nil leftView: _buttonContentView bottomView: _buttonContentView rightView: _buttonContentView edgeInset : UIEdgeInsetsZero];
349
+ [_buttonContentView addConstraintEqualWithView : button widthToView: nil heightToView: lastSecondBtn];
350
350
}
351
351
}
352
352
@@ -362,21 +362,21 @@ - (void)layouttextFields
362
362
_textFieldContentView.layer .borderWidth = _textFieldorderWidth;
363
363
_textFieldContentView.layer .borderColor = _textFieldBorderColor.CGColor ;
364
364
_textFieldTopConstraint.constant = -_contentViewSpace;
365
- [_textFieldContentView addConstraintToView: textField edageInset :UIEdgeInsetsMake (_textFieldorderWidth, _textFieldEdge, -_textFieldorderWidth, -_textFieldEdge)];
366
- [textField addConstarintWidth :0 height: _textFieldHeight];
365
+ [_textFieldContentView addConstraintToView: textField edgeInset :UIEdgeInsetsMake (_textFieldorderWidth, _textFieldEdge, -_textFieldorderWidth, -_textFieldEdge)];
366
+ [textField addConstraintWidth :0 height: _textFieldHeight];
367
367
}else {
368
368
// textField
369
369
UITextField *lastSecondtextField = _textFields[_textFields.count - 2 ];
370
- [_textFieldContentView removeConstraintWithView: lastSecondtextField attribte : NSLayoutAttributeBottom];
371
- [_textFieldContentView addConstarintWithTopView : lastSecondtextField toBottomView: textField constarint : _textFieldorderWidth];
372
- [_textFieldContentView addConstarintWithView : textField topView: nil leftView: _textFieldContentView bottomView: _textFieldContentView rightView: _textFieldContentView edageInset :UIEdgeInsetsMake (0 , _textFieldEdge, -_textFieldorderWidth, -_textFieldEdge)];
373
- [_textFieldContentView addConstarintEqualWithView : textField widthToView: nil heightToView: lastSecondtextField];
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];
374
374
375
375
// separateview
376
376
UIView *separateView = _textFieldSeparateViews[_textFields.count - 2 ];
377
- [_textFieldContentView addConstarintWithView : separateView topView: nil leftView: _textFieldContentView bottomView: nil rightView: _textFieldContentView edageInset : UIEdgeInsetsZero];
378
- [_textFieldContentView addConstarintWithTopView : separateView toBottomView: textField constarint :0 ];
379
- [separateView addConstarintWidth :0 height: _textFieldorderWidth];
377
+ [_textFieldContentView addConstraintWithView : separateView topView: nil leftView: _textFieldContentView bottomView: nil rightView: _textFieldContentView edgeInset : UIEdgeInsetsZero];
378
+ [_textFieldContentView addConstraintWithTopView : separateView toBottomView: textField constant :0 ];
379
+ [separateView addConstraintWidth :0 height: _textFieldorderWidth];
380
380
}
381
381
}
382
382
0 commit comments