Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Call delegate on drawing canvas points

  • Loading branch information...
commit 07d9ddeb87411f80d23549275842a07fc2b1d81e 1 parent 6ca9206
@drpancake authored
Showing with 7 additions and 2 deletions.
  1. +4 −1 JPCanvasViewController.h
  2. +3 −1 JPCanvasViewController.m
View
5 JPCanvasViewController.h
@@ -3,6 +3,7 @@
// Created by James Potter on 05/03/2012.
//
+#import "JPCanvasViewControllerDelegate.h"
#import "SBJson.h"
/*
@@ -40,9 +41,11 @@
#endif
/*
- Shared methods
+ Shared
*/
+@property (nonatomic, weak) id<JPCanvasViewControllerDelegate> delegate;
+
- (NSString *)execute:(NSString *)js;
@end
View
4 JPCanvasViewController.m
@@ -8,6 +8,7 @@
@implementation JPCanvasViewController
@synthesize webView=_webView;
+@synthesize delegate;
/*
OS X specific methods for preparing a WebView
@@ -94,7 +95,8 @@ - (BOOL)webView:(UIWebView *)theWebView
// TODO: handler method
if ([function isEqualToString:@"didDrawPoints"]) {
- NSLog(@"Got points: %@", args);
+ NSLog(@"JPCanvas got %i points", [args count]);
+ [self.delegate canvas:self didDrawPoints:args];
}
return NO;
Please sign in to comment.
Something went wrong with that request. Please try again.