Join Todd Perkins for an in-depth discussion in this video Understanding variables, part of Programming for Non-Programmers: iOS 8.
- View Offline
- Exercise Files
- The most basic building block…in programming is something called a variable.…Variables are the nouns of programming,…and by that I mean they're named containers that hold data,…the things of code.…The data can be numbers, text, or more complex values.…To imagine a more complex value…think of a contact in your phone.…A contact has an associated phone number…or multiple phone numbers, address,…email, maybe a nickname etcetera.…
An example of a basic variable…would be a user's score in a game.…Here's what a variable looks like.…Before we look at the code of a variable…let's discuss how a variable is created.…We start by using the var keyword which is lower case.…Then we give the variable a name,…and we say what type of data the variable is going to hold.…Is it going to be a number, is going to be text,…or is it going to be some other type of data?…Then we set the value using an equal sign,…so here's an example this line of code creates…a variable called score that is a number,…and sets its value to 100.…
At the beginning is the var keyword,…
If you find you'd like to learn more, see iOS App Development Essential Training, Foundations of Programming: Fundamentals, or any of the other programming courses in our library.
- Installing Xcode
- Creating an Xcode project
- Configuring the iOS Simulator
- Understanding variables
- Connecting visual objects to variables
- Understanding functions, methods, and selectors
- Connecting a button to a method
- Using conditional statements
- Setting up the user interface
- Connecting code elements to build an app
Skill Level Beginner
1. Setting Up Your Coding Environment
Creating an Xcode project3m 38s
2. Programming Building Blocks: Variables
3. Programming Building Blocks: Functions
4. Programming Building Blocks: Conditional Statements
Using conditional statements4m 11s
5. Building Your First Full Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.