Re: Problem with UIPanGestureRecognizer
Re: Problem with UIPanGestureRecognizer
- Subject: Re: Problem with UIPanGestureRecognizer
- From: Kyle Sluder <email@hidden>
- Date: Mon, 27 Jun 2016 10:01:21 -0500
On Sun, Jun 26, 2016, at 02:01 PM, William Squires wrote:
> I've got a simple project whose view controller has both a
> UITapGestureRecognizer and a UIPanGestureRecognizer.
> Both show up in the outline view (and their proxies(?) show up at the
> top of the view controller representation, along with the proxies for
> the view controller, the first responder, and "exit" (unwind segue?). I
> can confirm these are connected to my view controller (in swift, the
> dot-in-circle doohicky shows up to the left of the IBAction func
> grabDrop(sender: UIPanGestureRecognizer), and right-clicking on the
> proxy shows me the action connection to my view controller is in fact
> connected to grabDrop:, but... <drum roll, please>... a
> print("grabDrop:") right after the opening curly brace for the func
> never fires. How can I debug this? There's nothing to put a breakpoint
> on, since the code never fires, and one can't put a breakpoint on a
> storyboard. Help!!
Select the gesture recognizer and switch to the Connections inspector.
What’s listed next to “gestureRecognizers” in the “referencing outlet
connections” section? There should be exactly one view named there.
>
> i.e.
>
> (*) IBAction func grabDrop(sender: UIPanGestureRecognizer)
> {
> print("grabDrop:") // <- never gets here!!
> ...
> }
Just for the record, have you upgraded your project to Swift 3 yet? If
so, this function declaration should probably be styled `@IBAction func
grabDrop(_ sender:)`.
--Kyle Sluder
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden