Join Todd Perkins for an in-depth discussion in this video Using conditional statements, part of Programming for Non-Programmers: iOS 8.
- View Offline
- Exercise Files
- [Voiceover] So let's get some practice…using conditional statements.…I'm looking in Main.storyboard and I started…from a blank single view application template…and I put a label on the screen here.…And I extended it a little bit and I've connected it…to my code in ViewController.swift.…Again, for more information about that,…see chapter two in this course.…So let's write some code inside of viewDidLoad method.…I'm going to go a few lines below the comment.…Remember that this method is executed automatically…when our code runs and our user interface…elements are ready to work with.…
So here I'm going to write an if statement.…So I'm going to type the word if, and then some parenthesis.…And in many languages the parenthesis are required.…In Swift, however, they are not required, they are optional.…But I like putting in them in there…because I feel like it's easier to read.…So I'm going to do that…and I'm going to create some curly braces.…So go to the next line and type an open curly brace…and press return on my keyboard…
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?
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.