Exploring data types

All programming languages can store numbers, words, and logic conditions, and Swift is no different. Even if you're an experienced programmer, you may find that Swift implements storage for numbers, words, and logic conditions differently from other languages that you might be familiar with. Let's walk through the Swift versions of these simple data types, which are as follows:

  • Integers
  • Floating-point numbers
  • Booleans
  • Strings

After this, you will also take a look at how to use constants and variables to store these data types in the playground.

For more information on data types, visit: https://docs.swift.org/swift-book/LanguageGuide/TheBasics.html.

Get iOS 13 Programming for Beginners - Fourth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.