Skip to main content
  • Book
  • © 2023

Asynchronous Programming with SwiftUI and Combine

Functional Programming to Build UIs on Apple Platforms

Apress

Authors:

  • Improve the quality of your apps by applying Functional Reactive Programming
  • Incorporate third-party APIs and services
  • Integrate publishers, operators, and subscribers to effectively work together

Buy it now

Buying options

eBook USD 49.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Other ways to access

This is a preview of subscription content, log in via an institution to check for access.

Table of contents (16 chapters)

  1. Front Matter

    Pages i-xxvii
  2. 1

    1. Front Matter

      Pages 1-1
    2. SwiftUI: A New Beginning

      • Peter Friese
      Pages 3-31
    3. Getting Started with SwiftUI

      • Peter Friese
      Pages 33-67
    4. SwiftUI Building Blocks

      • Peter Friese
      Pages 69-92
    5. State Management

      • Peter Friese
      Pages 93-106
    6. Displaying Data in Lists

      • Peter Friese
      Pages 107-165
    7. Building Input Forms

      • Peter Friese
      Pages 167-204
  3. 2

    1. Front Matter

      Pages 205-205
    2. Getting Started with Combine

      • Peter Friese
      Pages 207-223
    3. Driving UI State with Combine

      • Peter Friese
      Pages 225-245
    4. Networking with Combine

      • Peter Friese
      Pages 247-274
    5. Error Handling in Combine

      • Peter Friese
      Pages 275-305
    6. Implementing Custom Combine Operators

      • Peter Friese
      Pages 307-316
    7. Wrapping Existing APIs in Combine

      • Peter Friese
      Pages 317-336
    8. Combine Schedulers and SwiftUI

      • Peter Friese
      Pages 337-359
  4. 3

    1. Front Matter

      Pages 361-361
    2. Getting Started with async/await

      • Peter Friese
      Pages 363-384
    3. Using async/await in SwiftUI

      • Peter Friese
      Pages 385-403

About this book

Develop UI-heavy applications more easily, faster, and error-free. Based on several enhancements to the Swift language, SwiftUI takes a declarative approach to building UIs. Instead of imperatively coding the UI, this book will show you how to describe how you want your UI to look.

SwiftUI treats the UI as a function of its state, thereby making managing your app’s state a lot easier. Change the underlying data model to redraw all parts of the UI that are connected to that particular slice of data. Likewise, easily update the underlying data model from the UI elements your data model is connected to. Combine is Apple’s Functional Reactive Programming framework. It complements SwiftUI and other frameworks, such as the networking APIs, in a natural way. Using Combine, you can subscribe to events and describe data processing in a way that is free of side effects. This allows for an easier implementation of event-driven applications.

Using SwiftUI and Combine build moreerror-free apps in a shorter amount of time, targeting all of Apple’s platforms (iOS, iPadOS, watchOS, macOS, tvOS) with little to no overhead.

By the end of the book you will have a solid understanding for architecting and implementing UI-heavy apps in a declarative and functional reactive way using SwiftUI, Combine, and async/await.

 

You will:

-       Build simple and gradually more complex UIs in SwiftUI

-       Understand SwiftUI’s state management system

-       Work with Combine and Swift’s new async/await APIs to access the network and access other asynchronous APIs

-       Architect and structure modern applications on Apple platforms using SwiftUI, Combine, and async/await


Authors and Affiliations

  • Hamburg, Germany

    Peter Friese

About the author

Peter Friese is a software engineer, author, speaker, and musician with a passion for helping developers build great apps. He works as a Developer Relations Engineer / Developer Advocate on the Firebase team at Google, where he focuses on helping developers build better apps using Firebase on iOS and other Apple platforms.

Peter shares his knowledge and experience through writing on his personal blog, peterfriese.dev, publishing videos on YouTube, speaking at conferences and meet-ups, crafting sample apps and contributing to the Firebase SDKs.

Prior to working at Google, he has held roles as a software engineer, software architect, and principal consultant at companies such as Lufthansa Systems, Gentleware, itemis, and Zühlke.

Bibliographic Information

  • Book Title: Asynchronous Programming with SwiftUI and Combine

  • Book Subtitle: Functional Programming to Build UIs on Apple Platforms

  • Authors: Peter Friese

  • DOI: https://doi.org/10.1007/978-1-4842-8572-5

  • Publisher: Apress Berkeley, CA

  • eBook Packages: Professional and Applied Computing, Apress Access Books, Professional and Applied Computing (R0)

  • Copyright Information: Peter Friese 2023

  • Softcover ISBN: 978-1-4842-8571-8Published: 14 January 2023

  • eBook ISBN: 978-1-4842-8572-5Published: 13 January 2023

  • Edition Number: 1

  • Number of Pages: XXVII, 434

  • Number of Illustrations: 76 b/w illustrations

  • Topics: Apple and iOS

Buy it now

Buying options

eBook USD 49.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book USD 64.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Other ways to access