diff --git a/ARPlayer/Gestures/NodeInsertionHandler.m b/ARPlayer/Gestures/NodeInsertionHandler.m index b839b1c..16e3de7 100644 --- a/ARPlayer/Gestures/NodeInsertionHandler.m +++ b/ARPlayer/Gestures/NodeInsertionHandler.m @@ -15,6 +15,10 @@ // Utils #import "PlaylistService.h" +#import "Constants.h" + +// Categories +#import "UIViewController+Helpers.h" @implementation NodeInsertionHandler @@ -22,6 +26,13 @@ - (void)handleGesture:(UIGestureRecognizer *)gesture inSceneView:(ARSCNView *)sc NSAssert([gesture isKindOfClass:[UILongPressGestureRecognizer class]], @"Different class type is expected."); if (gesture.state == UIGestureRecognizerStateBegan) { + SCNNode *node = [sceneView.scene.rootNode childNodeWithName:kMediaPlayerNode + recursively:YES]; + if (node != nil) { + [[UIApplication sharedApplication].keyWindow.rootViewController showMessage:@"It's possible to create only one instance of ARPlayer."]; + return; + } + CGPoint tapPoint = [gesture locationInView:sceneView]; NSArray *arHitTestResults = [sceneView hitTest:tapPoint types:ARHitTestResultTypeExistingPlaneUsingExtent]; diff --git a/ARPlayerTestHarness/AppDelegate.m b/ARPlayerTestHarness/AppDelegate.m index af828e4..b782174 100644 --- a/ARPlayerTestHarness/AppDelegate.m +++ b/ARPlayerTestHarness/AppDelegate.m @@ -15,7 +15,6 @@ @interface AppDelegate () @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - return YES; }