my goal transform uiview in animation. problem horizontal translation needs animated using spring/bounce animation while vertical translation needs animated without it.
the following code won't work because second transform replace first wanted illustrate want achieve.
is possible solve without animating views frame directly?
uiview.animatewithduration(0.5, delay: 0.0, usingspringwithdamping: 0.8, initialspringvelocity: 0.01, options: nil, animations: { () -> void in someview.transform = cgaffinetransformmaketranslation(-100, 0) }) { (completed) -> void in } uiview.animatewithduration(0.5, animations: { () -> void in someview.transform = cgaffinetransformmaketranslation(0, 100) })
one way make someview child of view gets second transformation applied.
uiview.animatewithduration(1, delay: 0.0, usingspringwithdamping: 0.8, initialspringvelocity: 0.01, options: nil, animations: { () -> void in self.someview.transform = cgaffinetransformmaketranslation(-100, 0) }) { (completed) -> void in } let someotherview = uiview(frame: self.view.frame); self.view.addsubview(someotherview); someotherview.addsubview(someview); uiview.animatewithduration(1, delay: 0.0, usingspringwithdamping: 0.8, initialspringvelocity: 0.01, options: nil, animations: { () -> void in someotherview.transform = cgaffinetransformmaketranslation(0, 100) }) { (completed) -> void in }
Comments
Post a Comment