ios - Animate titleView on button click -
i'm new animation in ios , i'm trying apply animation on titleview in navigationbar following code keep saying:
cannot invoke 'animatewithduration' argument list of type '(floatliteralconvertible, delay: floatliteralconvertible, options: uiviewanimationoptions, animations: () -> () -> $t4, completion: (($t16) -> ($t16) -> $t15) -> (($t16) -> $t15) -> $t15)'
when remove
self.navigationitem.titleview?.center = cgpointmake(10, 10)
there no error, how can apply animaiton on titleview/title?
@ibaction func animatebuttontapped(sender: uibarbuttonitem) { uiview.animatewithduration(0.7, delay: 1.0, options: uiviewanimationoptions.curveeaseout, animations: { self.navigationitem.titleview?.center = cgpointmake(10, 10) }, completion: { finished in println("basket doors opened!") }) }
uiview.animatewithduration(0.7, delay: 1.0, options:.curveeaseout, animations: { // optional chaining may return nil _ = self.navigationitem.titleview?.center = cgpointmake(10, 10) // return }, completion: { finished in println("basket doors opened!") })
Comments
Post a Comment