When I try to implement my protocol this way:
protocol Serialization {
func init(key keyValue: String, jsonValue: String)
}
I get an error saying: Expected identifier in function declaration.
Why am I getting this error?
Yes you can. But you never put func
in front of init
:
protocol Serialization {
init(key keyValue: String, jsonValue: String)
}