Join Harrison Ferrone for an in-depth discussion in this video Declare variables, part of Learning Swift 3 for Developers.
- [Instructor] Swift has the basic variable…types you would expect,…including strings, integers,…floating point numbers, and bullions.…As we write more code, you'll also notice…that there are no semicolon needed to end a line,…or even parentheses to encapsulate…comparisons or logical operators.…In essence, Swift is a language that can,…in the best of circumstances,…be read grammatically or at least…that's what we should all be striving for.…Make some room underneath our Operator section,…and put in a new comment.…
Backslash star,…Declaring Variables and Types,…star backslash.…Let's create our first variable called canChange.…Use the var keyword…and have it equal to a string that just says,…This variable canChange.…Don't worry about the string type just yet.…Our goal here is to understand the different ways…mutable and constant variables can be declared.…
For constants, we need to use the let keyword.…Let's give that a shot.…Let…cannotChange…equals…this variable…cannot change,…it's a constant.…At its most basic, that's all there is to it.…
- Starting a new playground
- Printing to the console
- Declaring variables
- Working with numbers
- Using strings
- Breaking down optionals
- Understanding closures
- Classes vs. structs
- Extensions and protocols
Skill Level Beginner
1. Hello Swift
2. Back to Basics: Variables and Operators
3. Collections, Tuples, and Enumerations
4. Working with Logic Flows
5. Only in Swift: Optionals
6. Functions, Closures, and Associated Types
7. Classes vs. Structs
8. Advanced Topics
- 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.