开发者

Detecting touch interactions which move from one view into another

I'm developing an iPhone a开发者_如何转开发pplication which involves an MPMoviePlayerController (and associated view) with another UIView on top of it, covering part of it. I'm looking for a way of detecting a touch which starts on the movie player view, and then moves into the overlayed view. Is there any way of detecting such an interaction?

I was originally going to override the touchesBegan:: method of the movie player view using categories, but I have read that this is recommended against and might be a problem when submitting to the app store.

Any suggestions would be greatly appreciated.


This goes against the way that the touch handling is designed to work. When the user touches a location on the screen, the top-most view will receive the touch events (if it is configured to handle touch interaction). No matter where the user drags, that initial view will receive the touch events until the user lifts their finger.

That being said, you could theoretically use the initial view to pass data to the second view controller (if the two UIViewController instances were aware of each other). For example, you could detect that if the UITouch instance was outside of a given bounds (like your view's frame) then you could manually pass that over to the second view controller to handle.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜