实现两个view的现实隐藏动画效果

func animateMyViews(viewToHide:UIView,viewToShow:UIView){

let animationDuration = 0.35

UIView.animateWithDuration(animationDuration, animations: {()->Void in

viewToHide.transform = CGAffineTransformScale(viewToHide.transform, 0.001, 0.001)

}){(completion)-> Void in

viewToHide.hidden = true

viewToShow.hidden = false

viewToShow.transform = CGAffineTransformScale(viewToShow.transform, 0.001, 0.001)

UIView.animateWithDuration(animationDuration, animations: {()->Void in

viewToShow.transform = CGAffineTransformIdentity

})

}

}

你可能感兴趣的:(实现两个view的现实隐藏动画效果)