button上的两个手势,

-(UITapGestureRecognizer *)clickOnceTapGestureFactory

{

    UITapGestureRecognizer *clickOnceGes = [[UITapGestureRecognizeralloc] initWithTarget:selfaction:@selector(deletePic:)];

    clickOnceGes.numberOfTapsRequired = 1; //设定点击次数

    return clickOnceGes;

  

}

 

-(UILongPressGestureRecognizer *)longPressGesFactory

{

    UILongPressGestureRecognizer *longPressGes = [[UILongPressGestureRecognizeralloc]initWithTarget:selfaction:@selector(setCover:)];

    longPressGes.minimumPressDuration = 0.5; //设定长按时间

    return longPressGes;

}

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