Looking for swift Answers? Try Ask4KnowledgeBase
Looking for swift Keywords? Try Ask4Keywords

Swift Language Structs cannot inherit


Example

Unlike classes, structures cannot inherit:

class MyView: NSView { }  // works

struct MyInt: Int { } // error: inheritance from non-protocol type 'Int'

Structures, however, can adopt protocols:

struct Vector: Hashable { ... }  // works