I'll start with what I'm trying to do: I wanted to create a nice little mixin that UIViews could utilize to abstract out intended touch events (that is, "in the way the user is dragging right now, do they really want to complete this action").
I thought the best way to do this would be to use a category, but I come to find they've been replaced by "extensions" in swift. Mostly. Apparently properties are now all computed.
To make this mixin work, I would need a local stored property in which to store a token "buffer of intent". But any attempt to add a var to the extension is presented with errors about how I need to provide setters and getters. A protocol won't work for the same reason. If I create a protocol alongside the extension, I still have to have a local ivar in which we store this new property.
So either one of two questions:
Am I going the long way around this, and if so, what should I be doing instead?
or
How do I do something where I can create a "mixin"-like structure that allows me to define simple properties and methods that should be mixed in?