If we use Interface Builder to edit the content in the view, then how do we add a drawRect to that UIView object? (Probably we want a new class FooView that subclasses UIView — but how will the .xib content be placed on this view?)
If we use Interface Builder to edit the content in the view, then how
Share
Adding “content” to the view controller’s view in the xib just involves adding subviews – these are not affected by
drawRect:.That said, to set a custom class as the main
viewproperty of a view controller, just select the view in the xib, go to the identity inspector, and change the class from UIView to your custom class.