Load custom UIView with XIB from a View Controller's view using IB
问题 I have a custom UIView ( MyCustomUIView ) which is built using Interface Builder. I'd like to place this custom view in MyViewController 's view, which is also designed using IB. I've placed an UIView as a subview in MyViewController 's XIB and set it's class to MyCustomUIView . The problem is, when I run the code, only a blank view appears. (When I instantiate MyCustomUIView in code, it displays well.) I'm only overriding the initWithFrame: method the following way in MyCustomUIView.m : -