Help calling "addTarget:action:forControlEvents:" from objc_util
The use case is a little complicated, and very task-specific:
- app is constantly listening for incoming messages
- manipulating controls in the view sends outgoing messages
- some incoming messages will try to set the value of a control being manipulated
- this leads to "fighting" between the user and the system
- knowing which control or controls are being interacted with, we can filter the incoming messages so they don't attempt to set controls actively being manipulated, effectively "debouncing" the signal
I like the idea of a transparent layer...but I wanted to be more specific about what I considered "manipulating" the control...with this, I can say exactly what I consider to be user interaction for these purposes.
Anyway, I am using the sender argument coming from the addTarget_action_forControlEvents() call, which is how I'm keying which controls are marked active. For my purposes it is working.Unfortunately, it seems like the various Pythonista-wrapped UIControls have different ways, or sometimes no way, of getting access to the actual UIControl instance they wrap, which makes it a little complicated to call the addTarget_ objectiveC method to install the monitor.