Advertisement
Guest User

Untitled

a guest
Mar 5th, 2013
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #import <UIKit/UIKit.h>
  2.  
  3. @interface ViewController : UIViewController <UIGestureRecognizerDelegate>
  4. @property (weak, nonatomic) IBOutlet UIButton *outletButton;
  5. - (IBAction)touchUpInside:(UIButton *)sender;
  6.  
  7. @end
  8.  
  9. ///////////////////////////////////////////////////
  10. #import "ViewController.h"
  11.  
  12. @interface ViewController ()
  13.  
  14. @end
  15.  
  16. @implementation ViewController
  17.  
  18. - (void)viewDidLoad
  19. {
  20.     [super viewDidLoad];
  21.     UISwipeGestureRecognizer *upRecognizer;
  22.     upRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeUp:)];
  23.     [upRecognizer setDirection: UISwipeGestureRecognizerDirectionUp];
  24.     upRecognizer.delegate = self;
  25.     [_outletButton addGestureRecognizer:upRecognizer];
  26. }
  27.  
  28. - (void)didReceiveMemoryWarning
  29. {
  30.     [super didReceiveMemoryWarning];
  31.     // Dispose of any resources that can be recreated.
  32. }
  33. -(void)handleSwipeUp:(UISwipeGestureRecognizer *)recognizer {
  34.    
  35.     NSLog(@"Swipe up on button");
  36. }
  37.  
  38. - (IBAction)touchUpInside:(UIButton *)sender
  39. {
  40.     NSLog(@"TouchUpInside");
  41. }
  42. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement