Join Todd Perkins for an in-depth discussion in this video Using conditional statements, part of Programming for Non-Programmers: iOS 7.
- View Offline
- Exercise Files
…Now, we'll get some practice writing our own conditional statement.…In viewcontroller.h, you'll see that I already…have an IB Outlet UI Label called Label.…The circle's filled in, so that means it's connected to a label in the storyboard.…Let's click on mainstoryboard.storyboard and, sure enough, there's a label there.…And if I click on View Controller on the…left side of the screen, show the utility view,…click on the code connections view and look…at label, I'll see it is, indeed, connected.…
So, I'll go to viewcontroller.m and here we'll write our conditional statement.…The first thing I want to do is hide the utilities…view so I have more space to write my code.…After line 20, I'll press Return a couple times, create some new lines.…Now I'm going to type, If.…When I type if, I see the code hinting window pop up.…It asks if I want to create an if statement or an if else statement.…I'm going to press the Down arrow on my keyboard to highlight,…If Else, and I'm going to press Return and see what happens.…
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?
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.