Currently I have a UITextField in a custom cell and I want to get the Y coordinate of that UITextField on the level of the View Controller's view (UIView). Currently I am trying to do something like this:
if (thetextField.superview.superview.superview.frame.origin.y >= keyboardY) {
}
But it seems that the Y coordinate is always 0 when it is in fact not. Is there any way to achieve this?
I am doing this because I want to detect whether the UIKeyboard is blocking the UITextField on the UIView level so that I can re-arrange my cells accordingly.
Thanks!