You can set your block property by filling out your setter like this:
- (void)setAction:(void (^)(UIControlEvents))action {
_action = action;
}
However, you won't be able to access any particular UIControlEvents
parameter as you requested because you're the one providing it. The action
block takes the UIControlEvents
value as an argument, so it won't be there within the block. Calling the action block with your UIControlEvents
parameter might look something like this:
- (void)handleControlEvents:(UIControlEvents)events {
if (self.action) self.action(events)
}