开发者

How to get the value of a touchLocation from a subclassed UIScrollView to the mainViewController?

开发者 https://www.devze.com 2022-12-14 00:49 出处:网络
Since the touch functions won\'t work until they are subclasses for the UIScrollView, I have subclassed them and get the touch coordinates in the subclass. But all my operations are being done in Main

Since the touch functions won't work until they are subclasses for the UIScrollView, I have subclassed them and get the touch coordinates in the subclass. But all my operations are being done in MainViewController开发者_开发百科. How can I send this value there? Might seem an easy question, but it is taking a lot of time for me.


I don't know what your answer is, but I just learned this technology a few days ago also. It was that, in the touchesBegan method of the view, I called

[self.nextResponder touchesBegan: touches withEvent: event];

and then wrote the touches began event in the view controller to which this passed the event.

Seems like no solution could be simpler.

John Doner

0

精彩评论

暂无评论...
验证码 换一张
取 消