Intermediate Combine
Apr 13 2021 · Video Course (21 mins)
Combine has a number of operators to help with handling network data, sharing resources with multiple subscribers, and managing errors. Once those are in place, you can perform unit tests on your Combine pipelines to make sure everything is running error-free…
iOS & Swift
Networking with Combine
Apr 13 2021 · Lesson
Combine comes with 2 special operators, dataTaskPublisher(for:) and decode()
that help you fetch data from the network in your Combine pipeline, and decode that
data using Swift’s built in decoders such as JSONDecoder
iOS & Swift
Testing Combine Operators
Apr 13 2021 · Lesson
…with all other code, your Combine pipeline code can, and should be, tested. The Given-When-Then pattern is a great way to layout your test code, ensuring that your code works as intended…
iOS & Swift
Sharing Resources
Apr 13 2021 · Lesson
Publishers in Combine are usually passed by value, since they are structs; however, you can use the built in Combine operator share() to pass them by reference, establishing one true subscription and simply sharing the data with other subscribers as they come along. Want to wait until…
iOS & Swift
Mapping Errors
Apr 13 2021 · Lesson
…encountered during execution of the code within the operator. The mapError operator lets developers maintain knowledge of errors encountered, passing them down the Combine pipeline…
iOS & Swift
Retrying and Catching Errors
Apr 13 2021 · Lesson
…need to retry if a failure is encountered. Networking is a great example here. If a download only partially completes, you can use Combine’s retry operator to retry the download. If other errors are encountered, including while retrying, you could try catch ing those errors to keep your…