Asynchronous Programming with SwiftUI and Combine

by Peter Friese

Programming

Book Details

Book Title

Asynchronous Programming with SwiftUI and Combine: Functional Programming to Build UIs on Apple Platforms

Author

Peter Friese

Publisher

Apress

Publication Date

2023

ISBN

9781484285718

Number of Pages

447

Language

English

Format

PDF

File Size

6.26MB

Subject

Programming

Table of Contents

  • About the Author
  • Foreword
  • Preface
  • Acknowledgments
  • About This Book
  • Part 1
  • Chapter 1: SwiftUI: A New Beginning
  • Why a New UI Framework?
  • SwiftUI Principles
  • A Quick Tour of SwiftUI
  • Exercises
  • Summary
  • Chapter 2: Getting Started with SwiftUI
  • What We’re Going to Build
  • Composing a View for Displaying a Book
  • Build the View with Static Data
  • Using the Preview to Make Sure Our View Works As Intended
  • Displaying a List of Books
  • Setting Up Data Binding
  • Adjusting the Preview Canvas
  • Making the Code Reusable
  • Views and View Modifiers
  • Exercises
  • Tips and Tricks
  • Summary
  • Chapter 3: SwiftUI Building Blocks
  • Views
  • View Modifiers
  • Summary
  • Chapter 4: State Management
  • Managing State in SwiftUI
  • Binding Value Types
  • Binding Objects
  • ObservableObject
  • @StateObject
  • @ObservedObject
  • @EnvironmentObject
  • Summary
  • Chapter 5: Displaying Data in Lists
  • Getting Started with Lists in SwiftUI
  • Dynamic Lists
  • Styling
  • Actions
  • Managing Focus in Lists
  • Summary
  • Chapter 6: Building Input Forms
  • Building Simple Forms
  • Showing Data in a Form
  • Make It Editable
  • Drill-Down Navigation
  • Input Validation
  • Summary
  • Part 2
  • Chapter 7: Getting Started with Combine
  • What Is Functional Reactive Programming?
  • Publishers
  • Subscribers
  • Operators
  • Composing Operators
  • Combining Publishers
  • Summary
  • Chapter 8: Driving UI State with Combine
  • Input Validation Using Combine
  • Exercises
  • Summary
  • Chapter 9: Networking with Combine
  • Fetching Data Using URLSession
  • Using Combine to Fetch Data
  • Connecting to the UI
  • Handling Multithreading
  • Optimizing Network Access
  • Bringing It All Together
  • Exercises
  • Summary
  • Chapter 10: Error Handling in Combine
  • Error Handling Strategies
  • Typical Error Conditions and How to Handle Them
  • Summary
  • Chapter 11: Implementing Custom Combine Operators
  • What Is a Combine Operator?
  • Implementing Custom Operators
  • Implementing a Retry Operator with a Delay
  • Conditionally Retrying
  • Implementing a Retry Operator for Exponential Backoff
  • Summary
  • Chapter 12: Wrapping Existing APIs in Combine
  • A Case Study
  • Using Combine to Access Firestore
  • Creating Your Own Publishers
  • Summary
  • Chapter 13: Combine Schedulers and SwiftUI
  • What Is a Scheduler
  • Types of Schedulers
  • Default Behavior
  • Switching Schedulers
  • Performing Asynchronous Work
  • Integrating with Other APIs
  • Summary
  • Part 3
  • Chapter 14: Getting Started with async/await
  • Synchronous Programming with Functions
  • Asynchronous Programming with Closures
  • Asynchronous Programming with async/await
  • Summary
  • Chapter 15: Using async/await in SwiftUI
  • Fetching Data Asynchronously Using URLSession
  • Calling Asynchronous Code
  • The Task View Modifier
  • Calling Asynchronous Code When the User Taps a Button
  • Using Pull-to-Refresh to Update Views Asynchronously
  • Searchable Views and async/await
  • Updating the UI from the Main Thread
  • Summary
  • Chapter 16: Bringing It All Together: SwiftUI, async/await, and Combine
  • Fetching Data Using Combine
  • Fetching Data Using async/await
  • Is This the End of Combine?
  • Connecting the UI…
  • …to a Combine Pipeline
  • …to an async/await Method
  • Calling Asynchronous Code from Combine
  • Summary
  • Index