How to Zoom In/Out Photo on double Tap in the iPhone WWDC 2010 – 104 PhotoScroller

I researched several different web sites and I came up with the following… Place this code into your viewDidLoad or viewWillAppear method: ////////////////////////////// // Listen for Double Tap Zoom UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleDoubleTap:)]; [doubleTap setNumberOfTapsRequired:2]; [self.scrollView addGestureRecognizer:doubleTap]; [doubleTap release]; Add this to your header file: – (void)handleDoubleTap:(UIGestureRecognizer *)gestureRecognizer; Add this to your … Read more

How do I detect if an SKSpriteNode has been touched

First set the name property of the SKSpriteNode to a string. pineapple.name = “pineapple” pineapple.userInteractionEnabled = false then in touchesBegan function in the Scene override func touchesBegan(touches: NSSet, withEvent event: UIEvent) { let touch:UITouch = touches.anyObject()! as UITouch let positionInScene = touch.locationInNode(self) let touchedNode = self.nodeAtPoint(positionInScene) if let name = touchedNode.name { if name == … Read more