Swift – Protocol extensions – Property default values
It seems you want to add a stored property to a type via protocol extension. However this is not possible because with extensions you cannot add a stored property. I can show you a couple of alternatives. Subclassing (Object Oriented Programming) The easiest way (as probably you already imagine) is using classes instead of structs. … Read more