Chapter 5
Swift and SwiftUI
IN THIS CHAPTER
Understanding the structure of Swift programs
Making comments
Declaring variables and constants
Using mathematical operators
Working with branching and looping statements
Creating functions, data structures, and objects
When the iPhone first came out, you couldn’t create apps for it. Developers pressured Apple into letting them create apps, and Apple finally relented and adopted Objective-C as the official language for creating iPhone apps.
Unfortunately, Objective-C can be just as difficult to learn as C++. That’s why in 2014, Apple introduced a much simpler, yet still powerful language called Swift. The main idea behind Swift is to offer a language that’s faster, safer, and easier than Objective-C. Because Swift is Apple’s official programming language, you should learn Swift if you plan to write apps for any of Apple’s various products ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access