I have a custom view that subclasses UIView. It has a touchesEnded event, however it does not show up in Interface Builder (under Events). I want to some how get that method into my View Controller so a method fires whenever the touchesEnded fires. I’m considering using target Action, however,
The code below doesn’t work because forControlEvents:UIControlEventTouchesEnded doesn’t exist. So I don’t know how I can get the touchesEnded method from my class that subclasses UIView.
[customView addTarget:self action:@selector(actionWithUIControlEvent:) forControlEvents:UIControlEventTouchUpInside];
Any help would be much appreciated!
Just let your view controller handling the event message. Implement the
touchesEnded:withEvent:method in it, and call the second.