效果
-(void)firstAction:(UIGestureRecognizer*)gen{
[UIView animateWithDuration:.2 animations:^{
_secodView.frame = CGRectMake(20, 0, [UIScreen mainScreen].bounds.size.width - 40 - 40, 400 - 50);
_firstView.frame = CGRectMake(0, -50, [UIScreen mainScreen].bounds.size.width - 40 , 400 - 50);
[_bgView sendSubviewToBack:_secodView];
[_bgView bringSubviewToFront:_firstView];
}completion:^(BOOLfinished) {
}];
}
-(void)secondAction:(UIGestureRecognizer*)tag{
[UIView animateWithDuration:.2 animations:^{
_secodView.frame = CGRectMake(0, 50, [UIScreen mainScreen].bounds.size.width - 40, 400 - 50);
_firstView.frame = CGRectMake(20, 0, [UIScreen mainScreen].bounds.size.width - 40 - 40, 400 - 50);
[_bgView sendSubviewToBack:_firstView];
[_bgView bringSubviewToFront:_secodView];
}completion:^(BOOLfinished) {
}];
}