通过界面构建​​器添加自定义uibutton

时间:2013-07-25 09:14:48

标签: objective-c uibutton interface-builder xib

我已经创建了一个自定义类,UIButton的子项,其中包含一些自定义功能。是否可以将此自定义按钮放在不使用代码的视图上,而是以某种方式使用Interface Builder,就像我们使用标准UIButton一样,将其从对象库中拖放到视图中?先感谢您!

1 个答案:

答案 0 :(得分:0)

In xib, select UIButton -> In Custom Class, select class as "CustomButton" name(Your custom class name).
Then declare your property,
@property(nonatomic,strong)IBOutlet CustomButton *yourButton;
connect this property to Files owner.