I have a custom UIView that I've created in a xib file. Now in another view controller, I have added a scroll view in the storyboard. In the implementation file for this view controller, I am trying to add this custom UIView, but it is not showing up. I'm sure I am missing something since I am still getting used to working with xib files. I have tried adding normal UIViews and those show up properly in the scroll view. This is the code:
[[NSBundle mainBundle] loadNibNamed:@"CustomUIView" owner:nil options:nil];
for (int i = 0; i < 10; i++) {
CustomUIView *setView = [[CustomUIView alloc] initWithFrame:CGRectMake(10, 10 + (10*i) + (i*100), self.view.frame.size.width - 20, 100)];
[self.scrollView addSubview:setView];
}
self.scrollView.contentSize = CGSizeMake(self.view.frame.size.width, 10 + (10*10) + (10*100));
The positioning for the frames worked for programmatically created UIViews in this loop so I don't think that is the issue. Any ideas? Thanks.