Swift conform to protocol subclass
问题 Within my app, I have multiple UIView subclasses that depend on a model. Each of the classes adopting ' Restorable ' protocol which holds the superclass of the model. Each sub-model describes the specific UIView not-common properties. // Super-model public protocol StoryItem { var id: Int64? { get } } // Parent protocol public protocol Restorable: AnyObject { var storyItem: StoryItem? { get set } } // Specific protocol public struct TextItem: StoryItem { public var id: Int64? public var text: