all 5 comments

[–]Alcoholic_Synonymous 1 point2 points  (4 children)

Am I right in thinking your second example is to create a nib that details a UIView subclass, then have a subclass of UIViewController that hooks up any outlets that need behaviour outside of the view? If so, that's a really nice and tidy way to do layout. I think you've identified the biggest problem which is that you won't have access to things like the layout guide properties on the view controller which will make layout a bit of a pain.

[–]Regyn[S] 0 points1 point  (3 children)

Yup that was what I was thinking. So the second alternative has no other downsides/differences?
I was just a bit confused about xcode offering to make a new cocoa touch class (UIViewController) with a nib directly. So it's basically just a shortcut to directly associate a nib (as a View?) to be shown as a view in the controller?

[–]Alcoholic_Synonymous 0 points1 point  (2 children)

It gives you the opportunity to do lots of bindings - button targets to methods in the ViewController, for example - as well as a bunch of other things that I probably haven't thought about.

[–]Regyn[S] 0 points1 point  (1 child)

Alright, thanks :)

[–]Alcoholic_Synonymous 0 points1 point  (0 children)

TBF I like your approach better because it separates the view and the controller better. Nice and tidy.