I have a protocol:
protocol InspectableSource
{
var headerView: NSView? { get }
var footerView: NSView? { get }
var mainContentViews: [NSView] { get }
}
Then I have a class that adopts this protocol:
class MyClass: InspectableSource
{
var mainContentViews: [MyNSViewSubclass]
}
The instance of MyClass
provides mainContentViews
, which is full of objects that are subclasses of NSView
. Swift whines about this and won't compile...because it's Swift.
So how do I declare in my protocol that mainContentViews
can be ANY type of object that is an NSView
or a subclass thereof?