title: UIbutton with longpress and Touchup inside
body: <p>How to create a UIButton With two actions.</p>
  
  <p>I know by using UILongPressGestureRecognizer we can perform Longpress.</p>
  
  <p>But my requirement is,When I Long Press UIButton,it has to perform one action and when touch</p>
  
  <p>up inside it, it has to perform another action.</p>
  
  <p>Thanks.</p>
  
  <p>Below is my code.</p>
  
  <pre><code>       UIImage *redImage = [UIImage imageNamed:@"TabFav2.png"];
  tabRedbutton = [UIButton buttonWithType:UIButtonTypeCustom];
  [tabRedbutton setImage:redImage forState:UIControlStateNormal];
  tabRedbutton.frame = CGRectMake(0.0, 0.0, 50,35);
  redTAb = [[UIBarButtonItem alloc] initWithCustomView:tabRedbutton];
  [tabRedbutton addTarget:self action:@selector(redbottonmethod)  forControlEvents:UIControlEventTouchUpInside];
  
  
  
   longpressGesture1 = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressHandler:)];
  longpressGesture1.minimumPressDuration =0.1;
  [longpressGesture1 setDelegate:self];
  longpressGesture1.cancelsTouchesInView = NO;
  [tabRedbutton addGestureRecognizer:longpressGesture1];
  
  [longpressGesture1 release];
  
   - (void)longPressHandler:(UILongPressGestureRecognizer *)gestureRecognizer {
  
     if (longpressGesture.state == UIGestureRecognizerStateBegan)
      {
    NSlog(@"Long press");
      }
  
   }
  
  
  -(void)redbottonmethod
   {  
  
    NSlog(@"single tapped");
   }
  </code></pre>