Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

neutrino23

macrumors 68000
Original poster
Feb 14, 2003
1,881
391
SF Bay area
I'm working through CS193P_SPR16 Developing iOS Apps with Swift on iTunes U. The professor, Paul Hegarty, is great. I'm enjoying this a lot. However, I've run into a dead end.

I have two questions:

1. In general, how does one go about solving this kind of problem? I can solve problems where the code doesn't behave properly but in this case it seems like I'm doing the right thing but Xcode doesn't recognize it.

2. Is there a better place to track down this kind of question?

The dead end is this:

I'm following along with the app the professor is developing as an example. Everything works find up till now and Xcode reports no issues. I can build the app and test it in the simulator.

The next step is to add pinch recognition.

I start typing"fac" and Xcode immediately recognizes

faceView so I type return then a ".a" and Xcode immediately offers me

faceView.addGestureRecognizer(<#T##gestureRecognizer:
UIGestureRecognizer##UIGestureRecognizer#>)

This is good so I press return and now I can enter the argument. So far this is exactly what I see in the professor's demo.

I start typing "UI" and Xcode offers many choices.

I get to "UIP" and now there are no choices. In the professor's video Xcode should offer:

UIPinchGestureRecognizer among other similar choices

as an option but now I have no options. So now I am stumped. I am happy to track this down but I need a hint about how to proceed. It recognized faceView as being declared in an Outlet. It knew that addGestureRecognizer was attached to that. According to the documentation UIPinchGestureRecognizer is a concrete subclass so why doesn't it appear?


Thanks.
 
Problem solved.

It turns out that it was due to an older version of Xcode. I was running 7.2 of Xcode. The current release is 7.3.1. I don't know why I wasn't automatically alerted to this. It usually tells me there is an update. Anyway, I manually downloaded this and now everything works like it does in the Stanford course tutorial.
 
  • Like
Reactions: yaxomoxay
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.