Skip to content

Commit

Permalink
Update master
Browse files Browse the repository at this point in the history
  • Loading branch information
yichizhang committed Jul 1, 2012
1 parent e62c460 commit d478148
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions Source/UIViewController+KNSemiModal.m
Expand Up @@ -67,13 +67,13 @@ -(void)presentSemiViewController:(UIViewController*)vc {
[self presentSemiView:vc.view];
}

-(void)presentSemiView:(UIView*)vc {
-(void)presentSemiView:(UIView*)view {
// Determine target
UIView * target = [self parentTarget];

if (![target.subviews containsObject:vc]) {
if (![target.subviews containsObject:view]) {
// Calulate all frames
CGRect sf = vc.frame;
CGRect sf = view.frame;
CGRect vf = target.frame;
CGRect f = CGRectMake(0, vf.size.height-sf.size.height, vf.size.width, sf.size.height);
CGRect of = CGRectMake(0, 0, vf.size.width, vf.size.height-sf.size.height);
Expand Down Expand Up @@ -105,14 +105,14 @@ -(void)presentSemiView:(UIView*)vc {
}];

// Present view animated
vc.frame = CGRectMake(0, vf.size.height, vf.size.width, sf.size.height);
[target addSubview:vc];
vc.layer.shadowColor = [[UIColor blackColor] CGColor];
vc.layer.shadowOffset = CGSizeMake(0, -2);
vc.layer.shadowRadius = 5.0;
vc.layer.shadowOpacity = 0.8;
view.frame = CGRectMake(0, vf.size.height, vf.size.width, sf.size.height);
[target addSubview:view];
view.layer.shadowColor = [[UIColor blackColor] CGColor];
view.layer.shadowOffset = CGSizeMake(0, -2);
view.layer.shadowRadius = 5.0;
view.layer.shadowOpacity = 0.8;
[UIView animateWithDuration:kSemiModalAnimationDuration animations:^{
vc.frame = f;
view.frame = f;
}];
}
}
Expand Down

0 comments on commit d478148

Please sign in to comment.