I have a type in my module:
import Cocoa
class ColoredDotView : NSView {
...
}
It is used in a number of different classes with no issue:
class EditSubjectPopoverController : NSObject {
@IBOutlet internal var subjectColorDotView : ColoredDotView!
...
}
But for some reason, when I use it in one specific class, I have compilation errors on the type:
class EditTaskPopoverController : NSObject {
@IBOutlet internal var lowPriorityDotView : ColoredDotView! // Error here
@IBOutlet internal var medPriorityDotView : ColoredDotView! // And here...
@IBOutlet internal var highPriorityDotView : ColoredDotView! // And here...
...
}
The compilation error is:
EditTaskPopoverController.swift:15:49: Use of undeclared type
'ColoredDotView'
Which I don't understand. It's the first compilation error in the file, and the rest of the errors are all symptomatic of the first. Further, there are no other files with compilation errors. I don't understand why the type is undeclared, as the file is in the same module:
I have tried cleaning the project, cleaning the build folder, and restarting Xcode, to no avail. What potential missteps can cause an undeclared type
compiler error in Swift?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…