Search code examples
iosobjective-ccoordinatesuitouch

how to set origin of coordinate to left & bottom uiview


I create an app in which I use UITouch and I get the touch position tapping on my view. I create one view with (height = 100px , width = 100px).

When I touch in my view from up to down, my touch position.y shows me these values (start from 0 to 100). I want the origin of coordinates to be left & bottom corner my view (namely I when touch my view from up to down my position to be low => 100 to 0)

How do I set the origin of the coordinate to the bottom left of my view?


Solution

  • You can calculate that y value with y = height - y