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;
精彩评论