Updated for Xcode 15
We’ve covered a lot about the basics of data in the previous chapters, so let’s recap:
let
, and variables using var
.let
so that Swift can help you avoid mistakes.count
and uppercased()
.isMultiple(of:)
.Double
, short for double-length floating-point number. That means they can hold very large numbers if needed, but they also aren’t 100% accurate – you shouldn’t use them when 100% precision is required, such as when dealing with money.+
, -
, *
, and /
, along with the special compound assignment operators such as +=
that modify variables directly.!
operator or by calling toggle()
.It’s a lot, right? And that’s okay – you’ll be using everything from that list time and time again as you build apps, until eventually you’ll understand it all without needing to refer back here.
TAKE YOUR SKILLS TO THE NEXT LEVEL If you like Hacking with Swift, you'll love Hacking with Swift+ – it's my premium service where you can learn advanced Swift and SwiftUI, functional programming, algorithms, and more. Plus it comes with stacks of benefits, including monthly live streams, downloadable projects, a 20% discount on all books, and free gifts!
Sponsor Hacking with Swift and reach the world's largest Swift community!
Link copied to your pasteboard.