IBDesignable… adding custom actions?

允我心安 提交于 2019-12-10 18:54:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!