I think this image explains it all. I have a subclass of UIView that I\'ve entered into the class field. I\'m trying to connect ibOutlets between the storyboard and class implem
To overcome XCode stubborness, especially when you need to hook up different enums from UIControlEvent
than UIControlEventTouchUpInside
, I'd rather use code directly from within the custom view class:
SWIFT
button.addTarget(self, action:#selector(ClassName.handleRegister(sender:)),
for: .touchDragExit)
OBJECTIVE-C
[self.button addTarget:self
action: @selector(buttonTouchDragExitAction:)
forControlEvents:UIControlEventTouchDragExit];
One might include such code in awakeFromNib
or viewDidLoad
or where it best suits.