There are multiple ways to set up connections between user interface objects and code in iOS development. This movie shows some alternate ways so you can decide which method you like best.
- [Instructor] So here on the screen…I have a label, and this is inside of Main.storyboard,…and I have it at the top left and I've stretched it out…using that center right handle so that it extends…just about the width of my storyboard.…When you're working with a storyboard…and you don't know exactly how much text is going to be,…you don't know if it's going to be this much…or this much in your label,…it's best to stretch it out a little bit…because that way you don't have the text…getting truncated in your label…when you're trying to write to it with code.…
So make sure you stretch out…those labels when you're using 'em.…So our goal now is actually to connect…this label to our code, but using an alternate method…than what we've looked at before.…So I want to show you how that works.…Now, we can go over to ViewController.swift…and you can see that I haven't actually…written any code in here, this is just the default…single view application template.…So what I'm gonna do is go to the next line…and I'm going to write my own code that says @IBOutlet.…
- Installing Xcode and the iOS SDK
- Creating layouts
- Adding interactions
- Changing labels and text fields
- Troubleshooting UI-to-code connections