Swift is a strongly typed language. Every value has a type, and the compiler enforces that you use values in type-safe ways. In this chapter, you'll learn about Swift's built-in types, how type inference works, and how to convert between types.
Type Inference
Swift can figure out the type of a value from context, so you don't always have to write it explicitly:
let age = 25 // Int (inferred)
let price = 9.99 // Double (inferred)
let name = "Swift" // String (inferred)
let isActive = true // Bool (inferred)You can also declare types explicitly using a type annotation:
let age: Int = 25
let price: Double = 9.99
let name: String = "Swift"
let isActive: Bool = trueBoth approaches produce the same result. Use type annotations when the type isn't obvious from the value, or when you want to be explicit for clarity.
Figure 1 — Type inference from literal syntax. Swift examines the literal value and automatically infers its type: numeric literals without decimals become Int, decimals become Double, text in quotes becomes String, and true/false become Bool.
Full content for this chapter will be added in a future update. The complete article covers type conversion, numeric types (Int, Double, Float), String operations, string interpolation, tuples, and Unicode fundamentals.

Ultimate iOS Bootcamp: Master Swift & SwiftUI App THE HARD WAY
Ship your apps faster
When you're ready to publish your Swift app to the App Store, Simple App Shipper handles metadata, screenshots, TestFlight, and submissions — all in one place.
Try Simple App Shipper