Tagged with concurrencyBrowse all tags
In this video, we're going to add Cancel Streaming Response to the ChatGPT iOS App using Swift Task Concurrency Cancellation. This is a continuation of the previous tutorials in "Build SwiftUI ChatGPT series"
In this article, we will be learning and experimenting with Swift Async Await to fetch multiple REST API endpoints and eliminate Pyramid of Doom callback hell to improve code readability and maintanability. I will introduce Structured Concurrency Task API to execute single and parallel async tasks. Finally, we'll use Continuation API to interface current synchronous code with callback to async function.
Grand Central Dispatch (GCD) is a framework provided by Apple that was released in 2009 with OS X Snow Leopard & iOS 4. It provides easy to use API for the developers to to run background tasks by creating queue in serial or concurrent style without managing threads by themselves.