Demystifying Views in iOS

Learn to organize your app ideas and designs in ways that work well with the latest versions of UIKit and Interface Builder. Eradicate View and View Controller confusion! By Jessy Catterwaul & Catie Catterwaul.

Leave a rating/review
Save for later
Comments
Share

Part 1: Nib Files

01
Toggle description

Get a little background on what these "views" are, that we'll be demystifying. Then find out the app you'll be building.

Toggle description

Create a nib file: the predecessor to the storyboard, and still a great option for designing views in Interface Builder.

Toggle description

Use a Bundle to load a nib, and then integrate the nib into your storyboard – both at runtime, and in Interface Builder.

Toggle description

A nib file's owner allows it to connect to its external environment using the convenience of Interface Builder outlets and actions.

Toggle description

You've got a view controller and a file's owner for your nib. If you can hook them together, you'll have successfully integrated interactivity with your nib.

Toggle description

You know how to connect outlets from a nib, to its File's Owner, and from the File's Owner to a view controller. But you can connect inter-nib objects too!

UINib 5:12
Toggle description

Sometimes you'll want to load objects from a nib multiple times. UINib is a better match for those cases than instantiating repeatedly from a Bundle.

Toggle description

You've used the nib you designed once in a storyboard. Now use it again four times over, all within an entirely new nib!

Conclusion 1:09
Toggle description

You've now learned all about a powerful tool: nib files! Let's review their similarities to storyboards and when nibs are more appropriate.

Part 2: Temporary Subviews

Toggle description

Part 1 is all about views, and Part 2, view controllers. This part will bridge the gap, with a focus on views that don't stay on-screen all the time.

Toggle description

Explore, in Swift, how you can take control over subviews (including ones loaded from nibs!) without necessarily using a view controller.

Toggle description

Learn to integrate a parent view into a view controller. The view controller will have to do some coordination, but its subviews can take over from there.

Scene Dock 6:04
Toggle description

Get some experience designing a view in the Scene Dock. It's a great place to put temporary views that are associated with only one view controller.

Toggle description

Combine the power of a custom UIView subclass and a Scene Dock object that uses that class. Storyboard scenes are flexible!

Toggle description

You're not limited to one temporary view in a scene. It's also possible to interact with Scene Dock views, and have them stick around until dismissed.

Although custom UIView subclasses for Scene Dock views are a helpful tool, they're not always necessary to get the job done. Go without, this time!

Conclusion 0:35
Toggle description

Views in nibs, views in the scene dock, view in parent views: when they're subviews of a view controller and temporary, you've got them down.

Part 3: Container View Controllers

Toggle description

Before you can convert one of your views to be a controller, get an idea of what a container view controller is, and its role in dependency injection.

Toggle description

It's time to power up your view to become a view controller! You'll learn to convert from a nib to a storyboard, and get started coding it as well.

Toggle description

There's a little bit more to worry about when adding a child view controller than there is for just a subview. Let's sort out the extra requirements.

Toggle description

Embed segues are an alternative to loading child view controllers in code, After this video, you'll be able to gauge which method is right for your needs.

Toggle description

It's time to see how much of what you've created for your first contained view controller can be reused for your latest one.

Toggle description

You'll be making the final view controller for the course, and using one of Apple's own container view controllers with it. Storyboard references make it easy!

Toggle description

Come get acquainted with the basics of View Models. You'll define one for a custom view lass, and then manage a collection of them with their view controller.

Toggle description

You've been coordinating between two parts of the screen with one container view controller. Now coordinate between two screens, with another.

Conclusion 2:05
Toggle description

Review the big ideas of what you've learned in the course. Start considering how all of your new view-organizing skills can benefit you in a team environment.