[xcode-iPhone]two quick touches
Hello, I would like to know how a button that recognizes a touch and two quick touche开发者_运维问答s
Try to add following action to Your Button
UIControlEventTouchDownRepeat
Example
    UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    button.frame = CGRectMake(100.0, 100.0, 80.0, 50.0);
    [button setTitle:@"Tap Me!" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(touchDownRepeat:) forControlEvents:UIControlEventTouchDownRepeat];     
    [self.view addSubview:button];
This might sound hackish, but you could subclass the UIButton and override the touch events and do you magic if [touch tapCount] == 2.
Don't start throwing stuff! I know it's not elegant.
 
         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论