Skip to content

Commit 5c75351

Browse files
12207480tanyang
authored andcommitted
add showAlertView and uiview category
1 parent fade0aa commit 5c75351

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

TYAlertControllerDemo/TYAlertController/TYAlertController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ - (void)addBackgroundView
118118
backgroundView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.4];
119119
[self.view addSubview:backgroundView];
120120
_backgroundView = backgroundView;
121-
[_backgroundView addConstraintToView:self.view edageInset:UIEdgeInsetsZero];
121+
[self.view addConstraintToView:_backgroundView edageInset:UIEdgeInsetsZero];
122122
}
123123

124124
- (void)addSingleTapGesture
@@ -140,7 +140,7 @@ - (void)setBackgroundView:(UIView *)backgroundView
140140
[self.view addSubview:backgroundView];
141141
backgroundView.translatesAutoresizingMaskIntoConstraints = NO;
142142
_backgroundView = backgroundView;
143-
[_backgroundView addConstraintToView:self.view edageInset:UIEdgeInsetsZero];
143+
[self.view addConstraintToView:_backgroundView edageInset:UIEdgeInsetsZero];
144144
[self addSingleTapGesture];
145145
}
146146
}

TYAlertControllerDemo/TYAlertController/TYAlertView.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ - (void)layoutButtons
295295

296296

297297

298-
[button addConstraintToView:_buttonContentView edageInset:UIEdgeInsetsZero];
298+
[_buttonContentView addConstraintToView:button edageInset:UIEdgeInsetsZero];
299299
[button addConstarintWidth:0 height:_buttonHeight];
300300
}else if (_buttons.count == 2) {
301301
UIButton *firstButton = _buttons.firstObject;
@@ -335,7 +335,7 @@ - (void)layoutTextFeilds
335335
_textFeildContentView.layer.borderWidth = _textFeildorderWidth;
336336
_textFeildContentView.layer.borderColor = _textFieldBorderColor.CGColor;
337337
_textFeildTopConstraint.constant = -_contentViewSpace;
338-
[textFeild addConstraintToView:_textFeildContentView edageInset:UIEdgeInsetsMake(_textFeildorderWidth, _textFeildEdge, -_textFeildorderWidth, -_textFeildEdge)];
338+
[_textFeildContentView addConstraintToView:textFeild edageInset:UIEdgeInsetsMake(_textFeildorderWidth, _textFeildEdge, -_textFeildorderWidth, -_textFeildEdge)];
339339
[textFeild addConstarintWidth:0 height:_textFeildHeight];
340340
}else {
341341
// textFeild

TYAlertControllerDemo/TYAlertController/TYShowAlertView.m

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ - (void)addBackgroundView
7777
[self addSubview:backgroundView];
7878
_backgroundView = backgroundView;
7979
_backgroundView.translatesAutoresizingMaskIntoConstraints = NO;
80-
[_backgroundView addConstraintToView:self edageInset:UIEdgeInsetsZero];
80+
[self addConstraintToView:_backgroundView edageInset:UIEdgeInsetsZero];
8181
}
8282

8383
- (void)setBackgroundView:(UIView *)backgroundView
@@ -88,7 +88,7 @@ - (void)setBackgroundView:(UIView *)backgroundView
8888
[self addSubview:backgroundView];
8989
_backgroundView = backgroundView;
9090
_backgroundView.translatesAutoresizingMaskIntoConstraints = NO;
91-
[_backgroundView addConstraintToView:self edageInset:UIEdgeInsetsZero];
91+
[self addConstraintToView:_backgroundView edageInset:UIEdgeInsetsZero];
9292
[self addSingleGesture];
9393
}
9494
}
@@ -153,7 +153,7 @@ - (void)show
153153
if (self.superview == nil) {
154154
[kCurrentWindow addSubview:self];
155155
self.translatesAutoresizingMaskIntoConstraints = 0;
156-
[self addConstraintToView:kCurrentWindow edageInset:UIEdgeInsetsZero];
156+
[kCurrentWindow addConstraintToView:self edageInset:UIEdgeInsetsZero];
157157
[self layoutAlertView];
158158
}
159159
self.alpha = 0;

TYAlertControllerDemo/TYAlertController/UIView+TYAutoLayout.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ @implementation UIView (TYAutoLayout)
1212

1313
- (void)addConstraintToView:(UIView *)view edageInset:(UIEdgeInsets)edageInset
1414
{
15-
[view addConstarintWithView:self topView:view leftView:view bottomView:view rightView:view edageInset:edageInset];
15+
[self addConstarintWithView:view topView:self leftView:self bottomView:self rightView:self edageInset:edageInset];
1616
}
1717

1818
- (void)addConstarintWithView:(UIView *)view topView:(UIView *)topView leftView:(UIView *)leftView

TYAlertControllerDemo/ViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ - (IBAction)showAlertViewInWindow:(id)sender {
7575

7676
UIView *redView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 200, 200)];
7777
redView.backgroundColor = [UIColor redColor];
78-
//[redView showInWindowWithOriginY:60];
79-
[redView showInController:self];
78+
[redView showInWindowWithOriginY:60];
79+
//[redView showInController:self];
8080
//[TYShowAlertView showAlertViewWithView:redView originY:60];
8181
}
8282

0 commit comments

Comments
 (0)