swift2 - "Binary operator > cannot be applied to two Float operands" error -
i have conditional looks like:
if sqrtf(powf(starttouch.x - (touches.first as! uitouch).locationinview(self.view).y, 2) + powf(starttouch.y-(touches.first as! uitouch).locationinview(self.view).y, 2)) > dragthreshold as! float { self.drag = false; }
i getting error says binary operator > cannot applied 2 float operands
. cannot understand why can't check if float greater float. error trying tell me?
the members of cgpoint
of type cgfloat
, , assuming on 64-bit architecture native type used store cgfloat
double
- try treating calculated values double
s (use sqrt()
, pow()
instead of float
versions)... using dragthreshold
double
well
Comments
Post a Comment