From the course: Xcode 15 Essential Training

Unlock this course with a free trial

Join today to access over 24,000 courses taught by industry experts.

Connecting a label

Connecting a label

- [Instructor] Now that we have a basic UI, let's take a look at connecting these UI elements to our code. If you'll remember when we worked with SwiftUI, the UI elements and code were in the same files, but in Storyboards you actually have to make connections between UI elements and code manually. You may have noticed that I switched from macOS to iOS here and I've created the user interface in the same way as we did for macOS. Simply open up the library, and then click and drag elements from the library onto the screen. One way to make the code connections is by Option clicking ViewController. So I'm in Main right now in my storyboard and I'm going to Option click ViewController. You may remember that Option clicking files in the project navigator is a setting that's controlled in Xcode, Settings, under Navigation. So if Option clicking doesn't open the file in the next editor, you can modify your settings here. I'm now going to hide the navigator area and the inspector area, also…

Contents