I\'m new to app development and I\'m following Apple\'s tutorial to learn. I\'ve looked through a lot of questions asked about this type of error but none of them are helpin
You're missing the ":"
in the selector, try the following instead:
button.addTarget(self, action: "ratingButtonTapped:", forControlEvents: .TouchDown)
I hope this help you.
For reference, I've decided to have a look at the sample and got a similar issue.
I'm using XCode 8 + Swift 3 and these are my changes in order to get it working:
button.addTarget(self, action: #selector(RatingControl.ratingButtonTapped), for: .touchDown)
Note: considering the file name "RatingControl.swift".
I hope it help =D
I had the same problem, Check the version of your Xcode.
If you have an older version update and this will probably fix your errors.
Regards, Driss
If you're using Swift 3, the line in question would have to be changed to:
button.addTarget(self, action: #selector(StarRatingControl.ratingButtonTapped), for: .touchDown)