开发者

how to create custom touch event and action

Hi i am new iphone i want to developing a application that is work on touch event. in this when user tou开发者_JS百科ch on screen then show a label msg u touch on right and same. how to do this i im confused plz tell me.


Basically What you will want to look at is subclassing UIView objects (which themselvs inherit from UIResponder), inside your subclass you can implement the following methods and add the required behavior to them:

  • -(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event:
  • -(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
  • -(void)touchesCanceled:(NSSet *)touches withEvent:(UIEvent *)event;

For more information I would look at the UIResponder.h file and the related documentation in xCode.

Another great place to continue your research and read some sample code is the Event Handling section in the iPhone Application Programming Guide

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜