How to access the current cordinate of UIButton from the super view, when occur the UIGestureRecognizerStateEnd

StackOverflow https://stackoverflow.com/questions/8574212

سؤال

I am new to iOS development. Now I am implementing an UIPanGestureRecognizer model application. I have one UIButton for UIPanGestureRecognizer. My question is, how can access the reside coordinate of UIButton from the super view (such as UIView, UIScrollView etc?)

if anybody know please help me.

هل كانت مفيدة؟

المحلول

You may use

CGRect rectInSuperView = [button convertRect:button.frame toView:superview];

Check the documentation

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top