For...reasons...I need to call the objective-C method:
addTarget_action_forControlEvents_()
on all the controls within a ui.View in my UI...but as I'm now aware, the actual object we get from ObjCInstance(view) or the view.objc_instance property is some SUIView object, like SUIButton or SUISlider, and the way to get down to the "real" UIControl or UIView object seems to vary from control to control...for a ui.Button, I can do:
realbutton = button.objc_instance.button()
but for a ui.Switch it's:
realswitch = switch.objc_instance.switchControl()
and for a ui.TextField it's:
realtextfield = textfield.objc_instance.textField()
and I found that for some, like ui.ImageView, there doesn't appear to be an obvious way to access the real UIView object...or there is, and I haven't found it...is there some more standardized way to access the underlying actual UIControl instance inside the Pythonista-wrapped controls? I can definitely map from each control type to the necessary access method, but that would have to be done per-control, and I'd prefer a generalized method.