This is part of the "iOS and Swift for Beginners" learning path. View Path

Demystifying Views in iOS

Oct 30 2018 · Intermediate · Video Course · 1 hr, 59 mins

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!

Version

  • Swift 4, iOS 12, Xcode 10

Nib Files

Introduction

3:04 Free

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

1

Creating Nib Files

8:35 Free

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

2

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

3

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

4

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.

5

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!

6

UINib

5:12

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.

7

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

8

Conclusion

1:09

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

9

Temporary Subviews

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.

10

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

11

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.

12

Scene Dock

6:04

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.

13

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

14

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.

15

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!

16

Conclusion

0:35

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.

17

Container View Controllers

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.

18

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.

19

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.

20

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.

21

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.

22

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!

23

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.

24

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

25

Conclusion

2:05

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.

26

Contributors

Comments