What I'd like to do is drag a component/view from one superview to another in Xcode's interface-builder without having its frame/position be reset.
Xcode's default behavior when doing this appears to be to center the view being moved vertically and horizontally in its new superview, while preserving its dimensions. This is extremely frustrating, as it means that the view needs to be manually repositioned in its new superview. But I had it positioned correctly before I moved it, so I'd like Xcode to just remember all attributes of its frame instead of just its width/height. Is this possible?
You can correct this by pressing Command + Option + = or selecting "Update Frames" in the |-•-| menu (I think it looks like a tie fighter).
The “Constrain to margins” checkbox determines whether constraints to the superview use the superview's margins or its edges. The lower portion of the popover lets you set the item's width or height. The Width and Height constraints default to the current canvas size, though you can type in different values.
A streamlined interface for laying out a collection of views in either a column or a row.
Try selecting your view in the storyboard and clicking on the identity inspector on the right side in class. Enter your view controller name and then drag and drop the item from the storyboard to the view controller. Hope it helps. Save this answer.
Another solution:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With