I am currently developing my first iOS application using Swift and I am running into a lot of issues with the UI portion of app development. I have decided to do all of the views programmatically because enough of them are complicated enough that I think storyboarding would be major pain.

My current issue is that I am trying to make all of the spacing on my views relative so that it doesn't matter what the screen size is when it's run. My first issue is spacing from the top down. I know that I have to account for both the Status Bar height and the Navigation Bar height. I know how to access both of these values when I am in a view controller, but I am struggling with where I should store these values. 

Do I have to access these values in every view controller where I use them? Do I pass these values to my views through the view controller or should all the framing be done in the view controller? I thought I understood the relationship between view controllers and views, but I'm not totally clear on how things like spacing are handled. Is that on the view controller end or the view? 

I know that I can hack this and get it to work, but I am more interested in what the "correct" way of doing this is. An example of a view and view controller that have been programmatically created and work with all devices would be awesome if someone has that available.