Swift Cookbook – Third Edition

by Keith Moon

Programming

Book Details

Book Title

Swift Cookbook – Third Edition

Author

Keith Moon

Publisher

Packt Publishing

Publication Date

2024

ISBN

9781803239583

Number of Pages

422

Language

English

Format

PDF

File Size

5.4MB

Subject

MOBIle-development

Table of Contents

  • Cover
  • Title Page
  • Copyright and Credits
  • Dedication
  • Contributors
  • Table of Contents
  • Preface
  • Chapter 1: Swift Fundamentals
  • Technical requirements
  • Writing your first code in Swift
  • Using the basic types – strings, ints, floats, and booleans
  • Reusing code in functions
  • Encapsulating functionality in object classes
  • Bundling values into structs
  • Enumerating values with enums
  • Passing around functionality with closures
  • Using protocols to define interfaces
  • Chapter 2: Mastering the Building Blocks
  • Technical requirements
  • Bundling variables into tuples
  • Ordering your data with arrays
  • Containing your data in sets
  • Storing key-value pairs with dictionaries
  • Subscripts for custom types
  • Changing your name with a type alias
  • Getting property changing notifications using property observers
  • Extending functionality with extensions
  • Controlling access with access control
  • Chapter 3: Data Wrangling with Swift
  • Technical requirements
  • Making decisions with if/else
  • Handling all cases with switch
  • Looping with for loops
  • Looping with while loops
  • Handling errors with try, throw, do, and catch
  • Checking upfront with guard
  • Doing it later with defer
  • Bailing out with fatalError and precondition
  • Chapter 4: Generics, Operators, and Nested Types
  • Technical requirements
  • Using generics with types
  • Using generics with functions
  • Using generics with protocols
  • Using advanced operators
  • Defining option sets
  • Creating custom operators
  • Nesting types and namespacing
  • Chapter 5: Beyond the Standard Library
  • Technical requirements
  • Comparing dates with Foundation
  • Fetching data with URLSession
  • Working with JSON
  • Working with XML
  • Chapter 6: Understanding Concurrency in Swift
  • Technical requirements
  • Leveraging DispatchGroups
  • Implementing the operation class
  • Async/Await in Swift
  • Chapter 7: Building iOS Apps with UIKit
  • Technical requirements
  • Building an iOS app using UIKit and storyboards
  • Unit and integration testing with XCTest
  • UI testing with XCUITest
  • Chapter 8: Building iOS Apps with SwiftUI
  • Technical requirements
  • Declarative syntax
  • Function builders, property wrappers, and opaque return types
  • Building simple views in SwiftUI
  • Combine and data flow in SwiftUI
  • Chapter 9: Getting to Grips with Combine
  • Technical requirements
  • Using Reactive Streams
  • Understanding Observable Objects
  • Understanding publishers and subscribers
  • Combine versus Delegate pattern
  • Chapter 10: Using CoreML and Vision in Swift
  • Technical requirements
  • Using CoreML models to detect objects in images
  • Building a video capture app
  • Using CoreML and the Vision framework to detect objects in real time
  • Chapter 11: Immersive Swift with ARKit and Augmented Reality
  • Technical requirements
  • Surface detection with ARKit
  • Using 3D models with ARKit
  • Using Reality Composer Pro for visionOS
  • Chapter 12: Visualizing Data with Swift Charts
  • Technical requirements
  • Building a chart with data
  • Displaying multiple datasets
  • Exploring chart marks and modifiers
  • Index
  • Other Books You May Enjoy