开发者

Setting the value of an UIView subclass custom parameter in IB

I created a subclass of an UIView called smartView. Then I created a NSInteger parameter viewID.

Now in the IB I change the class of a standard UIView to my smartView.

My question is how can I supply a value for my viewID parameter in IB?

Is it possible? If n开发者_运维问答ot, is there another way besides "Tag" parameter to give a UIView component a unique id?


I think the way to supply that value in IB would be to create a IB Plug-in.

See here for a tutorial, and here for the Apple Reference Document.


If you provide an IBOutlet for your smartView in the view controller then you can access it like:

self.mySmartView.viewID = _viewID;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜