I have extended the following protocol with a default parameter.
protocol XDelegate {
func close(response: Bool, status: Status)
}
extension XDelegate{
func close(response: Bool, status: Status = .UNDEFINED){}
}
whenever I call delegate.close(true)
it won't EVER call the function on the class that adopted this protocol.
I MUST do delegate.close(true, status: .UNDEFINED)
so it would call the function.
Is this the expected behavior?
I'm using Swift 2.3
EDIT: See the duplicate link and also see this answer and the comments below it.