Sometimes it can be hard to visualize where certain code elements are used. This video shows an example application that uses several conditional statements, and explains their roles in the app.
- [Narrator] Now you may have watched…the last few movies and been wondering…what on earth is the point of these…optionals, the Booleans, and those guard…statements, when is the practical use of all of this stuff?…I want to show you an example of a simple application.…This is the calculator that we're going…to build later on in this course.…And I want to show you what role those Boolean values play.…What role the if statements play and what…role the guard statement plays.…
So let's look at some of this sample code.…And again, you don't have to open up…the application and follow along, I just…want you to see what we're doing here.…So if we scroll down, we're already going…to see a Boolean value on line 23.…The name of this variable is called lastButtonWasMode…and it saves the data whether it was true or false…if the last button pressed while using…the calculator was a mode button.…Meaning was it a multiply button, the plus…button, the minus button, etc.…So it's held inside of that variable.…
We scroll down, you can see didPressNumber…
- Installing Xcode
- Creating an Xcode project
- Configuring the iOS Simulator
- Understanding variables
- Connecting visual objects to variables
- Understanding methods
- Connecting a button to a method
- Using conditional statements
- Setting up the user interface (UI)
- Building a complete iOS app
Skill Level Beginner
1. Set Up Your Coding Environment
Create an Xcode project4m 19s
2. Programming Building Blocks: Variables
3. Programming Building Blocks: Methods
4. Programming Building Blocks: Conditional Statements
5. Plan and Prepare the App
6. Build a Full Application
Next steps3m 11s
- 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.