How to extend a protocol in Swift

Protocol inheritance uses the regular inheritance syntax in Swift.

protocol Base {
    func someFunc()
}

protocol Extended : Base {
    func anotherFunc()
}

Swift Protocols do not by default conform to NSObjectProtocol. If you do choose to have your protocol conform to NSObjectProtocol, you will limit your protocol to only being used with classes.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)