From e7213f32bb4f667ef01c89e6fbbf9564612deb78 Mon Sep 17 00:00:00 2001 From: "Brian Olencki (bolencki13)" Date: Wed, 12 Apr 2017 18:38:45 -0400 Subject: [PATCH 1/2] Touch support --- Classes/AR/ARObject.h | 1 + Classes/AR/ARObject.m | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Classes/AR/ARObject.h b/Classes/AR/ARObject.h index 6013c61..a3755a9 100644 --- a/Classes/AR/ARObject.h +++ b/Classes/AR/ARObject.h @@ -29,6 +29,7 @@ #import "ARSettings.h" +extern NSNotificationName ARObjectTappedNotification; @interface ARObject : UIViewController { diff --git a/Classes/AR/ARObject.m b/Classes/AR/ARObject.m index f704a91..1dc389d 100644 --- a/Classes/AR/ARObject.m +++ b/Classes/AR/ARObject.m @@ -26,6 +26,7 @@ #import "ARObject.h" +NSNotificationName const ARObjectTappedNotification = @"kARObjectTappedNotification"; @interface ARObject () @@ -96,6 +97,12 @@ - (void)viewDidAppear:(BOOL)animated [distanceL setText:[self getDistanceLabelText]]; } +- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event +{ + [super touchesBegan:touches withEvent:event]; + + [[NSNotificationCenter defaultCenter] postNotificationName:@"kARObjectTappedNotification" object:self]; +} #pragma mark -- OO Methods From 047c083b2935a026eb7525a0d24830e86a9d133c Mon Sep 17 00:00:00 2001 From: "Brian Olencki (bolencki13)" Date: Wed, 12 Apr 2017 18:41:10 -0400 Subject: [PATCH 2/2] Fixed conflict with variable declaration --- Classes/AR/ARObject.h | 2 +- Classes/AR/ARObject.m | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Classes/AR/ARObject.h b/Classes/AR/ARObject.h index a3755a9..5206d0f 100644 --- a/Classes/AR/ARObject.h +++ b/Classes/AR/ARObject.h @@ -29,7 +29,7 @@ #import "ARSettings.h" -extern NSNotificationName ARObjectTappedNotification; +extern NSNotificationName const ARObjectTappedNotification; @interface ARObject : UIViewController { diff --git a/Classes/AR/ARObject.m b/Classes/AR/ARObject.m index 1dc389d..537187b 100644 --- a/Classes/AR/ARObject.m +++ b/Classes/AR/ARObject.m @@ -101,7 +101,7 @@ - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { [super touchesBegan:touches withEvent:event]; - [[NSNotificationCenter defaultCenter] postNotificationName:@"kARObjectTappedNotification" object:self]; + [[NSNotificationCenter defaultCenter] postNotificationName:ARObjectTappedNotification object:self]; } #pragma mark -- OO Methods