Join Todd Perkins for an in-depth discussion in this video Understanding conditional statements, part of Programming for Non-Programmers: iOS 7.
…The next building block for programming is called Conditional Statements.…What are conditional statements?…Conditional statements are if/then statements.…So if a certain condition that's evaluated as true or false turns out…to be true, then a line or section of code can be executed.…You can think of it kind of like a mini function…that only runs based on whether the condition is true or false.…In code, conditional statements start with if and then the condition in parenthesis.…
The condition, again, is evaluated as true or false.…The section of code to execute if the…condition is true is placed in curly braces.…An if statement can optionally be followed by an else…statement, which only runs if the condition is evaluated as false.…Let's look at a condition in code.…So here we have a very simple if statement.…If 1 is greater than 3.…Now if that statement is evaluated as true, then the…code inside of the curly braces right below if, will run.…
Of course, 1 is not greater than 3.…So the else statement will run in this example.…
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 function
- 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 project1m 55s
2. Programming Building Blocks: Variables
3. Programming Building Blocks: Functions
4. Programming Building Blocks: Conditional Statements
Using conditional statements5m 21s
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?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
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.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.