Pregunta

Is it possible to have IBAction property (like touchUpInside in UIButton?) for my custom view so I could link it with IBAction in Interface Builder?

It should look similar to this in my view header file:

@property IBOutlet <IBAction_type> myCustomIBAction;
¿Fue útil?

Solución

In your view controller's interface declaration, define a method with a return type of IBAction that takes single parameter of type id:

- (IBAction)buttonWasTapped:(id)sender;

Then in Interface Builder, right-click the button and drag from Touch Up Inside to your view controller. Select buttonWasTapped: from the popover.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top