From the course: Programming for Non-programmers: iOS 17 and Swift 5
Unlock this course with a free trial
Join today to access over 24,800 courses taught by industry experts.
Working with variables in a playground
From the course: Programming for Non-programmers: iOS 17 and Swift 5
Working with variables in a playground
- [Instructor] When you're working in X code, creating a playground allows you to prototype code so you can have very little code on the screen and just focus on one little piece. And that's what we're going to do to get a little bit of practice in working with variables. So in X code, go to file, new, and then choose playground or use the keyboard shortcut. So I'll click that, and then what I'm going to do is choose iOS, blank, and then hit next. And I'm going to give this just the default name and save it on my desktop. So there's my playground and I'll go into full screen mode, and it has this greeting that says "Hello, playground". And if you hit this play button right here to the left of the code, so that's right over the line number, then the app will build for a second and launch, and it will show you the values of variables on the right side of the screen. So that's really helpful when you're learning and when you're trying to develop things like algorithms. The first time you…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.