I would like to keep the content of a UITableView cell in a separate file as I do in Objective-c even in my TodayExtension Swift table in order to wire it to the storyboard. Yet when I try to do it, it complaints it cannot find the class of the cell; this is the function I use:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
println(indexPath)
let cell = tableView.dequeueReusableCellWithIdentifier( TableViewConstants.cellIdentifier, forIndexPath: indexPath) as! TodayCell
return cell
todayCell is the class in another file it reports it cannot find:
import UIKit class TodayCell: UITableViewCell {
@IBOutlet var bus: UILabel
@IBOutlet var stopAddress: UILabel!
@IBOutlet var destination: UILabel!
}
Importing the file, even if not needed according the the Swift documentation, moved the error in the import statement.
I found the problem: Xcode forgot to add the new TodayCell file to the list of compile sources when I added it to the project. Once I manually did it everything worked fine - I had a funny horror trip in a list of errors in the MKStoreManager library, but all of them went away upon returning to the last commit.