Knowing Combine’s feature set, you can identify areas of your code where using a Combine
pipeline would be most beneficial, which will allow you to keep your app up to date and provide
the best user experience possible. In this episode, use the requirements of the Jokes app
to see where Combine will work the best.
This content was released on Aug 5 2021. The official support period is 6-months
from this date.
Knowing Combine’s feature set, you can identify areas of your code where using a Combine
pipeline would be most beneficial, which will allow you to keep your app up to date and provide
the best user experience possible. In this episode, use the requirements of the Jokes app
to see where Combine will work the best.
Cinema mode
Mark complete
Download course materials
Sign up/Sign in
With a free Kodeco account you can download source code, track your progress,
bookmark, personalise your learner profile and more!
Check out our Reactive Programming in iOS with Combine and
Intermediate Combine courses to brush up on the skills you’ll need for this course. This course is based on the “Combine: Asychronous Programming with Swift” book from raywenderlich.com!
Transcript: 01. Identify Where to Use Combine
00:02If you’ve read tutorials or watched other videos about Combine, you’ve probably learned lots of distinct sets of information. But concepts don’t live in isolation - they have to be applied to an app. I happen to have here the next best selling app destined for the App Store - one that delivers Chuck Norris style jokes. Here’s a sneak preview of some of the features.
00:25The user can swipe left to say you don’t like the joke, or right to indicate you’ll remember this one for your next ice breaker at work. If the joke is not liked, it will turn red; otherwise it will turn green.
00:37The user can save jokes. The app will Automatically fetch a new joke, and show an indicator. The app will display appropriate error messages.
The user can toggle between English and Spanish versions of the jokes. The user can view their saved jokes. The user can delete saved jokes.
00:57I’ve identified quite a few areas where I could use Combine in the app. They are
01:01Defining a view model. SwiftUI natively uses Combine to keep your back end data and values displayed in the user interface in sync - but first we need to define a model that will hold those values.
01:16Once we have that ViewModel in place, we can tie it into SwiftUI using built-in property wrappers.
01:23The user will be able to save their favorite jokes, and that will happen by way of a Core Data database. Here, Combine will allow the user interface and the database to stay in sync as values are added or deleted.
01:37Finally, testing is vital in any app, and the Given-When-Then pattern can be used to test your code - including your Combine pipeline code. Using Combine in these areas should give our app the Chuck Norris style punch it needs.
00:25This course is based off the Combine: Asynchronous Programming with Swift book from raywenderlich.com - if you like what you see here and want to learn more, please check it out.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.