You have two options:
1. Use protocol
Define a superclass as a protocol instead of a class
Pro : checking compile time if each "subclass" (and not the actual subclass) implements the required method (s)
Con : "Superclass" (protocol) cannot implement methods or properties
2. Approval in the super version of the method
Example:
class SuperClass { func someFunc() { fatalError("Must Override") } } class Subclass : SuperClass { override func someFunc() { } }
Pro : you can implement methods and properties in a superclass
Con : compile-time checking
drewag Jun 08 '14 at 10:18 2014-06-08 22:18
source share