Boolean is a data type that holds true or false values. In other words, a Boolean's value only has two options: true and false. This video shows how to work with Boolean values.
- [Instructor] We've talked about variables already,…and we've talked about conditional statements.…There's actually a variable data type that works…very well with conditional statements…and that data type is called a Boolean.…A Boolean value is either true or false,…so let's look at creating a Boolean variable…and then using it in an if statement.…So inside of viewDidLoad,…I'm going to go right at the end of the comment,…go down a few lines and get some space.…And here I'm going to define a constant value.…
Let's say you're making an application and if the user's…logged in, then the user gets access to all of the content.…If the user is not logged in, then they're asked to log in.…So I'm going to define a constant using they keyword let.…Remember that let is the same as var,…but it's for variables that don't change.…These type of variables are called constants…and you can use let or var with a Boolean value.…So we'll call this one userIsLoggedIn.…
The name of the variable is long,…but it's also very descriptive.…
- 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.