Swift

Juan Jimenez
Juan Jimenez
4,389 Points

Where is the code?

Hello all,

I am working on the beginner swift class, auto layout videos. Pasan is working through the auto layout. I am curious though. When you are using the auto layout, where is the code being written. Where can I view the corresponding code, so that I can review it, and better understand the process as a whole?

2 Answers

Michael Hulet
MOD
Michael Hulet
Treehouse Moderator 46,972 Points

In effect, when you use Interface Builder (i.e. storyboards, .xibs, and .nibs) to build your layouts (including with AutoLayout), there really isn't any code. What you're seeing graphically effectively is the code. It's encoded into plain text in an XML-like syntax that you can see if you'd like by right-clicking the Interface Builder file you're working on and selecting "Open As > Source Code" in the menu that pops up, but no iOS developer actually works with that code directly. If you'd like to work with AutoLayout in code yourself, though, you should totally watch the workshop on Programmatic Auto Layout to learn more

Juan Jimenez
Juan Jimenez
4,389 Points

Thank you!! That is exactly what I was looking for!

Caleb Kleveter
MOD
Caleb Kleveter
Treehouse Moderator 37,859 Points

Each video has a 'Downloads' tab beneath it. Most of the time, there will be a 'Project Files' download with the current state of the project for that video in it.

Download tab for video