Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Jul 22nd, 2018 51 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. -(void)viewDidAppear:(BOOL)animated{
  2.     [self becomeFirstResponder];
  3.     [super viewDidAppear:animated];
  4. }
  5.  
  6. -(void)viewDidDisappear:(BOOL)animated {
  7.   [self resignFirstResponder];
  8. }
  9.  
  10. -(BOOL)canBecomeFirstResponder{
  11.     return YES;
  12. }
  13.  
  14. -(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event{
  15.     if (event.type == UIEventTypeMotion && event.subtype == UIEventSubtypeMotionShake) {
  16.         NSLog(@"shake began");
  17.  
  18.     }
  19. }
  20.  
  21. -(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event{
  22.     if (event.type == UIEventTypeMotion && event.subtype == UIEventSubtypeMotionShake) {
  23.         NSLog(@"shake ended");
  24.  
  25.         ViewDueController *dueController = [[ViewDueController alloc] initWithNibName:@"ViewDueController" bundle:nil];
  26.         [self resignFirstResponder]; //in teoria
  27.         [self.view addSubview:dueController.view];
  28.  
  29.     }
  30. }
  31.  
  32. -(void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event{
  33.     NSLog(@"shake cancelled");
  34. }
  35.    
  36. -(void)viewDidAppear:(BOOL)animated{
  37.     [self becomeFirstResponder];
  38.     [super viewDidAppear:animated];
  39. }
  40.  
  41. -(void)viewDidDisappear:(BOOL)animated {
  42.     [self resignFirstResponder];
  43. }
  44.  
  45. -(BOOL)canBecomeFirstResponder{
  46.     return YES;
  47. }
  48.  
  49. -(void)motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event{
  50.     if (event.type == UIEventTypeMotion && event.subtype == UIEventSubtypeMotionShake) {
  51.         NSLog(@"shake began 2");
  52.  
  53.     }
  54. }
  55.  
  56. -(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event{
  57.     if (event.type == UIEventTypeMotion && event.subtype == UIEventSubtypeMotionShake) {
  58.         NSLog(@"shake ended 2");
  59.  
  60.         ViewTreController *treController = [[ViewTreController alloc] initWithNibName:@"ViewTreController" bundle:nil];
  61.         //[self resignFirstResponder]; //in teoria
  62.         [self.view addSubview:treController.view];
  63.  
  64.     }
  65. }
  66.  
  67. -(void)motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event{
  68.     NSLog(@"shake cancelled");
  69. }
  70.    
  71. -(void)viewDidAppear:(BOOL)animated{
  72.     [self becomeFirstResponder];
  73.     [super viewDidAppear:animated];
  74. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top