The binding that we provide today to UIControl.AddTarget is hardcoded to one of the potential method signatures. AddTarget nowadays (or maybe always) supported a vaster set of callbacks, and the actual method invoked today depends on the signature of the selector:
https://developer.apple.com/documentation/uikit/uicontrol#1943645
These are:
@IBAction func doSomething()
@IBAction func doSomething(sender: UIButton)
@IBAction func doSomething(sender: UIButton, forEvent event: UIEvent)
Today, we only support the first kind, we would need to extend our API to take delegates that take a <UIControl> and a <UIControl,UIEvent> to handle those scenarios.
Today, a workaround I used was this:
slider.AddTarget (this, new ObjCRuntime.Selector ("slider:event:"), UIControlEvent.ValueChanged);
...
[Export ("slider:event:")]
void SliderMovedEvent (UISlider senderSlider, UIEvent uievent)
The binding that we provide today to
UIControl.AddTargetis hardcoded to one of the potential method signatures. AddTarget nowadays (or maybe always) supported a vaster set of callbacks, and the actual method invoked today depends on the signature of the selector:https://developer.apple.com/documentation/uikit/uicontrol#1943645
These are:
Today, we only support the first kind, we would need to extend our API to take delegates that take a
<UIControl>and a<UIControl,UIEvent>to handle those scenarios.Today, a workaround I used was this: