开发者

How to implement touch when using quartz-2d

开发者 https://www.devze.com 2023-02-27 16:50 出处:网络
I\'m using quartz-2d to do a school project. I have implement a user interface like the following.开发者_JS百科

I'm using quartz-2d to do a school project. I have implement a user interface like the following.

开发者_JS百科

How to implement touch when using quartz-2d

My question is how to implement touch function under quartz-2d ? For example when I touch some area in the menu will draw another picture?

Thanks


Quartz or no, you're still drawing into a view, and you probably still have a view controller, right? Both the view and the view controller are subclasses of UIResponder, so implement the usual -touchesBegan:withEvent:, -touchesEnded:withEvent:, etc. Since it's probably your view that knows how the various parts of your UI are drawn, it would make sense for the view to handle the touches, figure out which part of the UI was touched, and send higher-level messages to the view controller.

0

精彩评论

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