iOS: How can I remove reference to sub-views?

59 Views Asked by At

I'm creating an app that has hundreds of view controllers in interface-builder. Each of these view controllers has a button with a code number. When the button is pressed I want the button to expand and show a few lines of text describing the code number. The problem is that the button is placed within a subview that acts as a frame for the button. Therefore, the expanded button size is going to be constrained to that subview and the text will be cutoff. Is there a way for me to programmatically remove the reference to the sub-view? I can do this in interface-builder, but like I said there are hundreds of these view controllers.

1

There are 1 best solutions below

2
On

Instead I removing it you could expand the subView's and the UIButton's width. That would allow the button to expand as you'd like it to and you would not have to remove the subViews.