ios - Swift. Flip animation. FromView is not displayed -
i've wrote code create simple flip animation:
func frontview (view:uiview) ->uiview { var frontview: uiview frontview = uiview() frontview.frame = view.frame frontview.center = cgpoint(x: 0, y: 0) return frontview } func backview (view:uiview) ->uiview { var backview: uiview backview = uiview() backview.frame = view.frame backview.backgroundcolor = uicolor.redcolor() backview.center = cgpoint(x: view.frame.width/2, y: 0) view.addsubview(backview) return backview } func flipviewanimation (viewtoanimate: uiview) { var animationoption = self.animationoption var duration = self.duration uiview.transitionfromview(backview(viewtoanimate), toview: frontview(viewtoanimate), duration: duration, options: animationoption, completion: nil) // }
as viewtoanimate use views labels , imageviews inside, i've created in autolayout. result i'm trying achieve more or less should this. first see views filled color, flip , show content inside (labels , imageviews).
but works in different way. views appear content (labels , imageviews) flip , again show same content.
i've created each view programmatically , works me now.
Comments
Post a Comment