简体   繁体   中英

How do I manually call a UIView's touch event on the iPhone?

How do I manually touch a UIView means programattically.

I want to touch a view inside a UIScrollView touch manually.

Any idea how to do this?

Or how do I manually call UIScrollView's scrollViewWillBeginDecelerating?

This functionality is not intended to be used manually. You're better off adding a degree of indirection by adding a method.

Add a method that contains the functionality you want from the manual call

(void)manualFunctionality {...}

Then include a call to that method in your implementation of the scrollViewWillBeginDecelerating method.

This way, you are in accordance with the SDK's original intention and you can call your new method manually as much as you want.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM