Swift Data Types

Like most programming languages, Swift includes a full complement of built-in data types that store numbers, characters, strings, and Boolean values.

Note

In the previous section, we covered the use of Swift optionals, and worked through several examples declaring an Int variable as optional and non-optional. Keep in mind that any Swift variable, of any type, can be declared as an optional.

Numeric Data Types

Like most programming languages, Swift provides built-in numeric data types that represent either integer or floating-point values.

Int on 64-Bit Versus 32-Bit Platforms

While it's likely you'll develop Swift applications exclusively on 64-bit platforms, it's important to know that Swift is available on both 32-bit and 64-bit platforms. ...

Get Beginning Swift 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.