What this book covers
Chapter 1, Swift Fundamentals, introduces you to the basic concepts of Swift, its syntax, and the functionality of basic components. Additionally, you will be introduced to Apple’s Xcode IDE and Swift Playgrounds, which provide developers with powerful tools to create, execute, and debug their code efficiently, while also preparing you to follow the recipes throughout this book. You will learn how to write your first lines of code using Swift and understand the various basic elements that the Swift programming language has to offer.
Chapter 2, Mastering the Building Blocks, teaches you how to create more complex structures, building on top of the basic components covered in the first chapter, as well as utilizing some more advanced functionality available in the Swift standard library. You will learn how to use arrays, dictionaries, tuples, and some more abstract concepts, such as extensions and property observers.
Chapter 3, Data Wrangling with Swift, explains the importance of making decisions within programming and how to alter the control flow of your code. You will learn how to conditionally execute code with the if/else
and switch
statements. Additionally, you will have the chance to explore other approaches with for
and while
loops, and even how to handle Swift errors with the try
, throw
, do
, and catch
statements.
Chapter 4, Generics, Operators, and Nested Types, covers two advanced features of Swift, which are generics and operators. These features will aid you in building functionality that is both flexible and well-defined. Moreover, you will understand how nested types can be beneficial by allowing you to group types logically, control access to your constructs, and use namespacing.
Chapter 5, Beyond the Standard Library, assesses the frameworks that sit outside of the standard library, specifically the Foundation framework. Learning how to take advantage of these broader functionalities will help you make full use of the Swift programming language, taking your projects to the next level.
Chapter 6, Understanding Concurrency in Swift, outlines the concept of concurrency in programming and how it can be used to increase the performance and responsiveness of your code. You will learn the fundamental approach of concurrency in Swift, with Dispatch Queues and Dispatch Groups. Then, you will look at the modern concurrency approach in Swift, with the Async/Await framework.
Chapter 7, Building iOS Apps with UIKit, starts your journey of learning how to build your very own iOS applications, using the traditional UIKit framework. You will understand how to use storyboards to create a user interface. Then, you will explore the approach of testing behaviors and visual components within your app, using the XCTest and XCUITest frameworks.
Chapter 8, Building iOS Apps with SwiftUI, welcomes you to the modern and declarative user interface framework that is SwiftUI. You will expand your knowledge of the concepts used to build an app, covered in the previous chapter, by using a simplified process to create beautiful, interactive, and dynamic user interfaces. Additionally, you will learn how to take advantage of live previews within Xcode when building your SwiftUI application.
Chapter 9, Getting to Grips with Combine, discusses reactive programming and how to use the Combine framework to handle events and data changes in a functional and simplified manner. You will understand how to use a wide range of operators to manipulate streams of data, as well as handling errors and canceling operations.
Chapter 10, Using CoreML and Vision in Swift, dives into the concepts of machine learning and also looks at the CoreML and Vision frameworks, covering how to process machine learning models to use within your apps. You will learn how to build an app for intelligent image recognition and adapt powerful techniques for a live video streamed on your device.
Chapter 11, Immersive Swift with ARKit and Augmented Reality, explores how to blend the virtual and physical worlds with 3D objects through the lens of your device’s camera. You will learn the fundamentals of the ARKit framework and how to leverage the Augmented Reality tools available to create beautiful virtual scenes. Moreover, you will have the opportunity to create your first scene for visionOS.
Chapter 12, Visualizing Data with Swift Charts, shows you how to create visually appealing and easily understandable charts to represent data, using the Charts and SwiftUI frameworks. You will learn about the different types of chart markings, how to handle multiple datasets, and how to use visual modifiers.