How to satisfy a protocol which includes an initializer?

Ok, my bad.

To guarantee that all subclasses conform to MyProtocol new initializer has to be marked as required as well.

Furthermore Swift requires to declare all required initializers directly within the class and does not allow to declare them in extensions.

extension MyClass : MyProtocol {
    required convenience init(name: String) {
        self.init()
        self.name = name
    }
}

Leave a Comment