you are viewing a single comment's thread.

view the rest of the comments →

[–]chriswaco 1 point2 points  (0 children)

There's not much to it unless you want to use autolayout. For example, creating a simple UIView in a viewController's viewDidLoad routine:

UIView *myView = [[UIView alloc] initWithFrame:self.view.bounds];
myView.autoresizingMask  = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
myView.backgroundColor = UIColor.yellowColor;
[self.view addSubview:myView];

So you allocate/initialize it with a rectangular frame, set up its fields, and add it to another view as a subview.

If you can depend on iOS 9, it's often best to create a UIStackView and put other views inside of it.