一个button,一个手势+一个事件(touchupinside)

- (void)configureArrowButton:(UIButton *)button

                    withText:(NSString *)text

                     fastTap:(SEL)fastTapSel

                     deepTap:(SEL)deepTapSel

{

   // button.titleLabel.font = [UIFont fontWithName:@"Hiragino Mincho ProN" size:20];

    [button setTitleColor:[UIColordarkGrayColor] forState:UIControlStateNormal];

    [button setTitleColor:[UIColorblackColor] forState:UIControlStateHighlighted];

    [button setTitleShadowColor:[UIColorwhiteColor] forState:UIControlStateNormal];

    //button.titleLabel.shadowOffset = CGSizeMake(0,1);

    //[button setTitle:text forState:UIControlStateNormal];

 

   

    [button addTarget:selfaction:fastTapSel forControlEvents:UIControlEventTouchDown];

    UILongPressGestureRecognizer * deepPress = [[UILongPressGestureRecognizeralloc] initWithTarget:selfaction:deepTapSel];

    deepPress.allowableMovement = 15.0;

    deepPress.cancelsTouchesInView = NO;

    [button addGestureRecognizer:deepPress];

}

1,当一个按钮上同时 加事件和 手势,ios5不支持的,

原文地址:https://www.cnblogs.com/guligei/p/3068321.html