I have a protocol:
protocol ApiEndpointsProtocol {
func getKey(for endpoint: API.Keys, withChar: Bool) -> String
}
and I want to initialize withChar
to be always true if no value is provided, this is my attempt:
extension ApiEndpointsProtocol {
func getKey(for endpoint: API.Keys, withChar: Bool = true) {
getKey(for: endpoint, withChar: withChar)
}
}
But I'm getting a warning on the function call: getKey(for: endpoint, withChar: withChar)
Result of call to 'getKey(for:withChar:)' is unused
What's the right approach to do this?
Here's a screenshot: