I struggled with this for a long time. Suppose I have a UIViewController, and you need to place a UIImageView with a UIImage in this controller. Therefore, I have two ways to do this:
1.) Through the storyboard
2.) UIImageView *imageView = [UIImageView new];
imageView.frame = CGRectMake(bla, bla, bla);
[self.view addSubview: imageView];
I also need to support different screen sizes (from iPhone 4 to iPhone6 โโ+), and autostart with restrictions is not completely clear to me. And I sh * tcoding like
int wrapperHeight = (screen.height == 480) ? 100 : 200
I feel like I'm doing something wrong. When I started learning objective-c, I saw some open source projects, and there wasnโt a storyboard at all, so I thought adding views programmatically was good practice.
Could you explain the โright wayโ to me?
source
share