Getting real position of UItextField in UIScrollView
ios, xcode
Solution
The `UIView` class provides methods to convert coordinates from one view to another.
To convert a view's origin to screen coordinates you would do:
CGPoint screenOrigin = [someView convertPoint:someView.bounds.origin toView:nil];
Passing `nil` for the `toView` means to convert to screen coordinates.
In your case, replace `someView` with `textname`.
Problem
I have a series of UItextViews in a UIscrollview. The number of textviews there are depends on the user, there can be as many as he wants. I assign to each UItextView (which I add to an NSMutableArray) the same UItapGestureRecogniser. When a UItextView is tapped on, a line is drawn which connects the textField to a point that is touched on the screen by the user. Everything works fine, except for the fact that when I scroll down, I get a wrong y coordinate for my starting point, which I set in this way: ``` CGPoint coords; coords.y = textname.frame.origin.y + 15; ``` ...where textname is the sender of the gesture Is there a way to get the coordinate of the actual screen, without considering that the UItextView is in a UIscrollView??