Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Build a Simple iPhone App with Swift 2.0 Improving Our User Interface Adding a Pop of Color

Welby Obeng
Welby Obeng
20,340 Points

ViewController has a backing view and can be access through view....

ViewController has a backing view and can be access through view object.....How do you know that? and how do you know it can me access through view object. Is there a video that covered this that I missed?

1 Answer

Michael Hulet
Michael Hulet
47,913 Points

Basically what it's saying is that every view controller is tied to a view. This makes sense, right? A view controller needs a view to control. On every view controller, the view controller's view is accessible with the view property. You can access it like this:

let vc = UIViewController()

//This grabs the view property of the UIViewController object above and assigns it to vcView
let vcView: UIView = vc.view