From the course: Learning Combine with Swift

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Solution: Create a simple Combine data stream

Solution: Create a simple Combine data stream - Swift Tutorial

From the course: Learning Combine with Swift

Start my 1-month free trial

Solution: Create a simple Combine data stream

(upbeat music) - How did you do? This is how I solved the challenge. The first thing I did in order to create a publisher and associate it with an array is go to line 15. Enter the following let publisher equal array dot publisher. Now I need to create a subscriber. So go to line 17 and answer the following. Let subscriber equal publisher dot assign to backspace dot is enabled on text field. Below that, just so we can track where the text field does change, we will need to add a publisher. So let's go ahead and do that underneath our previous code. Text field dot publisher for backspace dot is enabled dot sink and in curly brackets and curly brackets we're going to enter print parenthesis dollar zero, close parenthesis, close curly brackets. Finally, we need to create an operator that skips the first two elements using the operator drop First, let's go ahead and do that. Go to line…

Contents