animateWithDuration in Swift - Could not find member 'CurveEaseOut' -
i following error when attempting pass variable in animation in swift:
could not find member 'curveeaseout'   my code seems fine if type degrees in manually:
uiview.animatewithduration(2.0, delay: nstimeinterval(0.0), options: .curveeaseout, animations: {         self.arrowimage.transform = cgaffinetransformmakerotation((180.0 * cgfloat(m_pi)) / 180.0)     }, completion: nil)   but have issue if attempt use variable:
var turn = double()  turn = 180.0  uiview.animatewithduration(2.0, delay: nstimeinterval(0.0), options: .curveeaseout, animations: {         self.arrowimage.transform = cgaffinetransformmakerotation((turn * cgfloat(m_pi)) / turn)     }, completion: nil)   perhaps it's use of double()? i've tried various different types , can't find solution.
there nothing wrong .curveeaseout. problem think within closure.
try
var turn:cgfloat = 180.0   if error remains arrowimage optional , have use if let unwrapped it
uiview.animatewithduration(2.0, delay: nstimeinterval(0.0), options: .curveeaseout, animations: {         if let ai = self.arrowimage {              ai.transform = cgaffinetransformmakerotation((turn * cgfloat(m_pi)) / turn)        }     }, completion: nil)      
Comments
Post a Comment