问题
I'm new to Xcode and I assume there's a way to do it but I can't seem to figure it out.
I have made a custom control by subclassing UIView and using IBDesignable.
However, I can't seem to figure out how to send events from within my control to a IBAction outside of it.
回答1:
You need to subclass UIControl not UIView. Once Interface Builder sees an UIControl subclass then send events section and actions will be available.
Accessing the Control’s Targets and Actions
来源:https://stackoverflow.com/questions/35799945/ibdesignable-adding-custom-actions