I have a class
public class Thing
like this
var blah:Thing
blah.name = "text"
it occurred to me, it would be fantastic if I could just "override the equals sign", when the item on the right is a string.
Then you could have
var blah:Thing
var x:Thing
blah = "text" // Swift knows I mean blah.name = "text"
blah = x // Swift knows I mean blah becomes x as normal
Am I missing something obvious? How to do?
Note that you can of course take over the subscript operation, using
public subscript
which is fantastic. Can you take over the "=" equals sign?