Swift BasicsLesson 9Free preview
Swift Data Types
This lesson is part of Swift · All levels
Summary
This lesson discusses the basic data types that Swift supports. Swift is a language with statically typed and tight data types. Basic types include Int for integers, Double and Float for decimal numbers, Bool for truth logic, Character for single characters, and String for text.
Key points
- The 'Int' type adapts the CPU architecture (64-bit on modern iPhones and Macs)
- The 'Double' type is a 64-bit decimal number of double precision (default for a comma number)
- The 'Float' type is a single 32-bit precision decimal number
- The 'Bool' type is only worth 'true' or 'false'
- Swift does not allow operations between different data types without explicit type conversion
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.