@IBOutlet weak var ratingControl: RatingControl! – Use of undeclared type ‘RatingControl’

These two errors may occour when taking the ”Start Developing iOS Apps (Swift)” from apple.com:

” ‘weak’ may only be applied to class and class-bound protocol types, not ‘<<error type>>'”

”Use of undeclared type ‘RatingControl'”


This happens when your UITableViewCell, in this case ”MealTableViewCell”, has at target Membership to ”FoodTrackerTests” but RatingControl has not.



Select ”RatingControl.swift”, then in the right navigation, select the file icon at the top (next to the questionmark). Then check ”FoodTrackerTests”. Now your error will go away.