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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.