I’m just working on a new porject an I’m working actually with simple coordinates:
if (locationOnJoystick.x > joystickArea.frame.size || locationOnJoystick.y > joystickArea.frame.size) {
But while running the code I get an ERROR:
error: invalid operands to binary > (have ‘CGFloat’ and ‘CGSize’)
Can anyone see the solution?!
Sincerly,
mavrick3.
locationOnJoystick.xis aCGFloat, whilejoystickArea.frame.sizeis aCGSize. They’re different types, you cannot compare them.I guess you should compare
locationOnJoystick.xwith the width of yourjoystickArea.frame.size(and the same with y and height):