1.视图切换动画
func completionHandler(flag:Bool){
}
UIView.transitionFromView(view1, toView: view2, duration: 0.5, options: UIViewAnimationOptions.TransitionFlipFromLeft, completion: completionHandler)
2.视图动画效果
UIView.beginAnimations(nil , context: nil )
UIView.setAnimationTransition(UIViewAnimationTransition.CurlUp, forView: image1, cache:true )
UIView.setAnimationDuration(1.0)
UIView.commitAnimations()
3.自定义动画
func animation()
{
image1.alpha = 0.5
image1.center = CGPoint(x: 50, y: 100)
}
func completionHandler(flag:Bool)
{
}
override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
UIView.transitionWithView(image1, duration: 1.0, options: UIViewAnimationOptions.TransitionNone, animations: animation , completion: completionHandler)
}