ios - CGFloat and NSTimeInterval "Cannot assigned a value of type Float to a value of type Int" -


i keep getting cannot assigned value of type float value of type int" on touchvelocityx = xfloat / timefloat though i'm converting floats.

    let lasttouchx = locationoflasttouch.x     let lasttouchy = locationoflasttouch.y     let currenttouchx = touchlocation.x     let currenttouchy = touchlocation.y      let xdistance = currenttouchx - lasttouchx     let ydistance = currenttouchy - lasttouchy      let xfloat = float(xdistance)     let yfloat = float(ydistance)      let timesincelasttouch = nsdate().timeintervalsincedate(timeoflasttouch)     let timefloat : float = float(timesincelasttouch)      touchvelocityx = xfloat / timefloat     touchvelocityy = yfloat / timesincelasttouch     timeoflasttouch = nsdate()     locationoflasttouch = touchlocation 


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -