Skip to content
This repository
Browse code

Switching to fast forwarding

  • Loading branch information...
commit 5525ee54c8e9b69f83b35220d51310c6d942137a 1 parent 6f676d5
Kailoa Kadano authored May 10, 2009
4  Classes/TouchSampleCodeViewController.m
@@ -57,7 +57,8 @@ CGSize CGSizeDistanceBetween2Points(CGPoint point1, CGPoint point2)
57 57
 
58 58
 /*********************************************************************/
59 59
 #pragma mark -
60  
-#pragma mark ** Touch Timer Methods **
  60
+#pragma mark ** Touch Utility Methods **
  61
+
61 62
 - (void)touchIsBeingPinchedOrStretched:(NSSet *)touches;
62 63
 {
63 64
     // calculate the distance between the two touches    
@@ -72,6 +73,7 @@ - (void)touchIsBeingPinchedOrStretched:(NSSet *)touches;
72 73
                                                            x_scale_factor, 
73 74
                                                            y_scale_factor);
74 75
 }
  76
+
75 77
 - (void)touchIsBeingHeldWithTimer:(NSTimer *)timer;
76 78
 {
77 79
     NSSet *touches = [timer userInfo];
16  Classes/TouchSampleView.m
@@ -36,6 +36,21 @@ - (void)dealloc {
36 36
 // actually breaks _some_ MVC patterns.  Conversely, in some apps, it makes 
37 37
 // sense to compartmentalize touch handling with the controllers.
38 38
 
  39
+- (id)forwardingTargetForSelector:(SEL)sel
  40
+{
  41
+    NSString *sel_string = NSStringFromSelector(sel);
  42
+    if ([sel_string isEqualToString:@"touchesBegan:withEvent:"]
  43
+        || [sel_string isEqualToString:@"touchesMoved:withEvent:"]
  44
+        || [sel_string isEqualToString:@"touchesEnded:withEvent:"]
  45
+        || [sel_string isEqualToString:@"touchesCancelled:withEvent:"])
  46
+        return ViewController;
  47
+    else
  48
+        return (id)super;
  49
+}
  50
+
  51
+
  52
+//The above is roughly equivalent to the following "manual forwarding"
  53
+/*
39 54
 - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event 
40 55
 {
41 56
     [ViewController touchesBegan:touches withEvent:event];
@@ -52,5 +67,6 @@ - (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event
52 67
 {
53 68
     [ViewController touchesCancelled:touches withEvent:event];
54 69
 }
  70
+*/
55 71
 
56 72
 @end

0 notes on commit 5525ee5

Please sign in to comment.
Something went wrong with that request. Please try again.