diff --git a/MSender/ViewController.m b/MSender/ViewController.m index 7f2fb92..b85b3ba 100755 --- a/MSender/ViewController.m +++ b/MSender/ViewController.m @@ -67,6 +67,9 @@ - (void)viewDidLoad { //Add Tree & Filter [self TreeImagenFilter]; + self.view.layer.masksToBounds = YES; + self.view.layer.cornerRadius = 8; + [self addObserver:self forKeyPath:@"treeWaveProgress" options:NSKeyValueObservingOptionNew context:nil]; } @@ -106,7 +109,7 @@ - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView _LNew.alpha = 0; - + [self pop_removeAllAnimations]; } -(void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView{ @@ -133,8 +136,11 @@ - (void)popAnimation { animation.springSpeed = 8; animation.completionBlock = ^(POPAnimation *anim, BOOL finished){ - [self.scview setContentOffset:CGPointMake(0, 0)]; - [self pop_removeAnimationForKey:@"popAnimation"]; + if (finished) { + + [self.scview setContentOffset:CGPointMake(0, 0)]; + [self pop_removeAnimationForKey:@"popAnimation"]; + } }; animation.property = [POPAnimatableProperty propertyWithName:@"popAnimationProgress" initializer:^(POPMutableAnimatableProperty *prop) { prop.readBlock = ^(ViewController *obj, CGFloat values[]) { @@ -209,13 +215,14 @@ - (void) parallax{ //Wave the trees when the plan fly across them:) - (void)setTreeWave{ - _treeWaveProgress = -0.33; POPSpringAnimation *animation = [self pop_animationForKey:@"treeWaveAnimation"]; if (!animation) { animation = [POPSpringAnimation animation]; animation.springBounciness = 30; animation.springSpeed = 5; + animation.fromValue = @(-0.33); + animation.toValue =@(0.01); animation.completionBlock = ^(POPAnimation *anim, BOOL finished){ if (finished) { @@ -236,7 +243,7 @@ - (void)setTreeWave{ [self pop_addAnimation:animation forKey:@"treeWaveAnimation"]; } - animation.toValue =@(0.01); + } - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context