Priya Talreja avatar

Chapter 6 - Variables and Constants

priyatalreja

Published: 23 May 2018 › Updated: 23 May 2018Chapter 6 - Variables and Constants

Chapter 6 - Variables and Constants

  • Variables are nothing but reserved memory locations to store values.
  • The value of a constant can’t be changed once it’s set, whereas a variable can be set to a different value in the future.
  • Declare constants with the let keyword and variables with the var keyword.
  • Constant and variable names can’t contain whitespace characters, keywords, mathematical symbols, arrows, Unicode code points.

Swift Tutorials Priya Talreja

You can provide a type annotation when you declare a constant or variable, to be clear about the kind of values the constant or variable can store. Write a type annotation by placing a colon after the constant or variable name, followed by a space, followed by the name of the type to use.

Swift Tutorials Priya Talreja

Github Link for Swift-Playgrounds

My next blog will be on Swift Optionals

Priya Talreja Xcode Tutorials
Please let me know if you have any doubts or queries in the comment section below.
Follow me priyatalreja@priyatalreja to get the latest feeds of iOS App step by step development tutorials.
Thanks.

Leave Chapter 6 - Variables and Constants to:

Written by

Developer

Read more #ios posts


Best Posts From Priya Talreja

We have not curated any of priyatalreja's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Priya Talreja