Skip to content

Commit bd911bb

Browse files
author
费凯峰
committed
Modify the wrong character.
1 parent 3fc83aa commit bd911bb

File tree

5 files changed

+72
-72
lines changed

5 files changed

+72
-72
lines changed

TYAlertControllerDemo/TYAlertController/TYAlertController.m

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ - (void)addBackgroundView
166166
}
167167
_backgroundView.translatesAutoresizingMaskIntoConstraints = NO;
168168
[self.view insertSubview:_backgroundView atIndex:0];
169-
[self.view addConstraintToView:_backgroundView edageInset:UIEdgeInsetsZero];
169+
[self.view addConstraintToView:_backgroundView edgeInset:UIEdgeInsetsZero];
170170
}
171171

172172
- (void)setBackgroundView:(UIView *)backgroundView
@@ -176,7 +176,7 @@ - (void)setBackgroundView:(UIView *)backgroundView
176176
} else if (_backgroundView != backgroundView) {
177177
backgroundView.translatesAutoresizingMaskIntoConstraints = NO;
178178
[self.view insertSubview:backgroundView aboveSubview:_backgroundView];
179-
[self.view addConstraintToView:backgroundView edageInset:UIEdgeInsetsZero];
179+
[self.view addConstraintToView:backgroundView edgeInset:UIEdgeInsetsZero];
180180
backgroundView.alpha = 0;
181181
[UIView animateWithDuration:0.3 animations:^{
182182
backgroundView.alpha = 1;
@@ -245,7 +245,7 @@ - (void)configureAlertViewWidth
245245
{
246246
// width, height
247247
if (!CGSizeEqualToSize(_alertView.frame.size,CGSizeZero)) {
248-
[_alertView addConstarintWidth:CGRectGetWidth(_alertView.frame) height:CGRectGetHeight(_alertView.frame)];
248+
[_alertView addConstraintWidth:CGRectGetWidth(_alertView.frame) height:CGRectGetHeight(_alertView.frame)];
249249

250250
}else {
251251
BOOL findAlertViewWidthConstraint = NO;
@@ -257,7 +257,7 @@ - (void)configureAlertViewWidth
257257
}
258258

259259
if (!findAlertViewWidthConstraint) {
260-
[_alertView addConstarintWidth:CGRectGetWidth(self.view.frame)-2*_alertStyleEdging height:0];
260+
[_alertView addConstraintWidth:CGRectGetWidth(self.view.frame)-2*_alertStyleEdging height:0];
261261
}
262262
}
263263
}
@@ -267,7 +267,7 @@ - (void)configureAlertViewWidth
267267
- (void)layoutAlertStyleView
268268
{
269269
// center X
270-
[self.view addConstraintCenterXToView:_alertView CenterYToView:nil];
270+
[self.view addConstraintCenterXToView:_alertView centerYToView:nil];
271271

272272
[self configureAlertViewWidth];
273273

@@ -294,11 +294,11 @@ - (void)layoutActionSheetStyleView
294294
}
295295

296296
// add edge constraint
297-
[self.view addConstarintWithView:_alertView topView:nil leftView:self.view bottomView:self.view rightView:self.view edageInset:UIEdgeInsetsMake(0, _actionSheetStyleEdging, 0, -_actionSheetStyleEdging)];
297+
[self.view addConstraintWithView:_alertView topView:nil leftView:self.view bottomView:self.view rightView:self.view edgeInset:UIEdgeInsetsMake(0, _actionSheetStyleEdging, 0, -_actionSheetStyleEdging)];
298298

299299
if (CGRectGetHeight(_alertView.frame) > 0) {
300300
// height
301-
[_alertView addConstarintWidth:0 height:CGRectGetHeight(_alertView.frame)];
301+
[_alertView addConstraintWidth:0 height:CGRectGetHeight(_alertView.frame)];
302302
}
303303
}
304304

TYAlertControllerDemo/TYAlertController/TYAlertView.m

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -279,26 +279,26 @@ - (void)layoutContentViews
279279
return;
280280
}
281281
if (_alertViewWidth) {
282-
[self addConstarintWidth:_alertViewWidth height:0];
282+
[self addConstraintWidth:_alertViewWidth height:0];
283283
}
284284

285285
// textContentView
286286
_textContentView.translatesAutoresizingMaskIntoConstraints = NO;
287287

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)];
289289

290290
// textFieldContentView
291291
_textFieldContentView.translatesAutoresizingMaskIntoConstraints = NO;
292-
_textFieldTopConstraint = [self addConstarintWithTopView:_textContentView toBottomView:_textFieldContentView constarint:0];
292+
_textFieldTopConstraint = [self addConstraintWithTopView:_textContentView toBottomView:_textFieldContentView constant:0];
293293

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)];
295295

296296
// buttonContentView
297297
_buttonContentView.translatesAutoresizingMaskIntoConstraints = NO;
298298

299-
_buttonTopConstraint = [self addConstarintWithTopView:_textFieldContentView toBottomView:_buttonContentView constarint:0];
299+
_buttonTopConstraint = [self addConstraintWithTopView:_textFieldContentView toBottomView:_buttonContentView constant:0];
300300

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)];
302302
}
303303

304304
- (void)layoutTextLabels
@@ -309,44 +309,44 @@ - (void)layoutTextLabels
309309
}
310310
// title
311311
_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];
313313

314314
// message
315315
_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];
318318
}
319319

320320
- (void)layoutButtons
321321
{
322322
UIButton *button = _buttons.lastObject;
323323
if (_buttons.count == 1) {
324324
_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];
327327
}else if (_buttons.count == 2) {
328328
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];
333333
}else {
334334
if (_buttons.count == 3) {
335335
UIButton *firstBtn = _buttons[0];
336336
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];
342342

343343
}
344344

345345
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];
350350
}
351351
}
352352

@@ -362,21 +362,21 @@ - (void)layouttextFields
362362
_textFieldContentView.layer.borderWidth = _textFieldorderWidth;
363363
_textFieldContentView.layer.borderColor = _textFieldBorderColor.CGColor;
364364
_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];
367367
}else {
368368
// textField
369369
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];
374374

375375
// separateview
376376
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];
380380
}
381381
}
382382

TYAlertControllerDemo/TYAlertController/TYShowAlertView.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ - (void)addBackgroundView
8484
}
8585
[self insertSubview:_backgroundView atIndex:0];
8686
_backgroundView.translatesAutoresizingMaskIntoConstraints = NO;
87-
[self addConstraintToView:_backgroundView edageInset:UIEdgeInsetsZero];
87+
[self addConstraintToView:_backgroundView edgeInset:UIEdgeInsetsZero];
8888
}
8989

9090
- (void)setBackgroundView:(UIView *)backgroundView
@@ -106,7 +106,7 @@ - (void)didMoveToSuperview
106106
{
107107
if (self.superview) {
108108
self.translatesAutoresizingMaskIntoConstraints = NO;
109-
[self.superview addConstraintToView:self edageInset:UIEdgeInsetsZero];
109+
[self.superview addConstraintToView:self edgeInset:UIEdgeInsetsZero];
110110
[self layoutAlertView];
111111
}
112112
}
@@ -115,11 +115,11 @@ - (void)layoutAlertView
115115
{
116116
_alertView.translatesAutoresizingMaskIntoConstraints = NO;
117117
// center X
118-
[self addConstraintCenterXToView:_alertView CenterYToView:nil];
118+
[self addConstraintCenterXToView:_alertView centerYToView:nil];
119119

120120
// width, height
121121
if (!CGSizeEqualToSize(_alertView.frame.size,CGSizeZero)) {
122-
[_alertView addConstarintWidth:CGRectGetWidth(_alertView.frame) height:CGRectGetHeight(_alertView.frame)];
122+
[_alertView addConstraintWidth:CGRectGetWidth(_alertView.frame) height:CGRectGetHeight(_alertView.frame)];
123123

124124
}else {
125125
BOOL findAlertViewWidthConstraint = NO;
@@ -131,7 +131,7 @@ - (void)layoutAlertView
131131
}
132132

133133
if (!findAlertViewWidthConstraint) {
134-
[_alertView addConstarintWidth:CGRectGetWidth(self.superview.frame)-2*_alertViewEdging height:0];
134+
[_alertView addConstraintWidth:CGRectGetWidth(self.superview.frame)-2*_alertViewEdging height:0];
135135
}
136136
}
137137

TYAlertControllerDemo/TYAlertController/UIView+TYAutoLayout.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@
1010

1111
@interface UIView (TYAutoLayout)
1212

13-
- (void)addConstraintToView:(UIView *)view edageInset:(UIEdgeInsets)edageInset;
13+
- (void)addConstraintToView:(UIView *)view edgeInset:(UIEdgeInsets)edgeInset;
1414

15-
- (void)addConstarintWithView:(UIView *)view topView:(UIView *)topView leftView:(UIView *)leftView
16-
bottomView:(UIView *)bottomView rightView:(UIView *)rightView edageInset:(UIEdgeInsets)edageInset;
15+
- (void)addConstraintWithView:(UIView *)view topView:(UIView *)topView leftView:(UIView *)leftView
16+
bottomView:(UIView *)bottomView rightView:(UIView *)rightView edgeInset:(UIEdgeInsets)edgeInset;
1717

18-
- (void)addConstarintWithLeftView:(UIView *)leftView toRightView:(UIView *)rightView constarint:(CGFloat)constarint;
18+
- (void)addConstraintWithLeftView:(UIView *)leftView toRightView:(UIView *)rightView constant:(CGFloat)constant;
1919

20-
- (NSLayoutConstraint *)addConstarintWithTopView:(UIView *)topView toBottomView:(UIView *)bottomView constarint:(CGFloat)constarint;
20+
- (NSLayoutConstraint *)addConstraintWithTopView:(UIView *)topView toBottomView:(UIView *)bottomView constant:(CGFloat)constant;
2121

22-
- (void)addConstarintWidth:(CGFloat)width height:(CGFloat)height;
22+
- (void)addConstraintWidth:(CGFloat)width height:(CGFloat)height;
2323

24-
- (void)addConstarintEqualWithView:(UIView *)view widthToView:(UIView *)wView heightToView:(UIView *)hView;
24+
- (void)addConstraintEqualWithView:(UIView *)view widthToView:(UIView *)wView heightToView:(UIView *)hView;
2525

2626
- (NSLayoutConstraint *)addConstraintCenterYToView:(UIView *)yView constant:(CGFloat)constant;
2727

28-
- (void)addConstraintCenterXToView:(UIView *)xView CenterYToView:(UIView *)yView;
28+
- (void)addConstraintCenterXToView:(UIView *)xView centerYToView:(UIView *)yView;
2929

3030
- (void)removeConstraintWithAttribte:(NSLayoutAttribute)attr;
3131

32-
- (void)removeConstraintWithView:(UIView *)view attribte:(NSLayoutAttribute)attr;
32+
- (void)removeConstraintWithView:(UIView *)view attribute:(NSLayoutAttribute)attr;
3333

3434
- (void)removeAllConstraints;
3535

0 commit comments

Comments
 (0)