Fork me on GitHub

UIViewController touch events

需要创建一个UIView, 把touch event写在此UIView里, 然后在controller里创建此UIView

@interface YourCustomView : UIView

@implementation YourCustomView

// Override this function to get the touch
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
NSLog(@"TOUCH!");
}

 

@interface YourViewController : UIViewController
{
YourCustomView* view
}




posted on 2012-03-06 15:06  pengyingh  阅读(524)  评论(0)    收藏  举报

导航