RxSwift: Transforming Operators

Glad you’re good to go now. Re: “if this is something I want to learn,” I can help you with that: Yes! :grin:

I got rid of the pod error messages but now am getting No Such Module RxSwift and an error on import RxSwift line. Also the Pods_RxSwiftPlayground.framework seems to be missing.

Installing RxSwift for this tutorial

As for this tutorial and all projects in the book, they all come with a completed Podfile, but without the dependency files included. We looked into this option, but it didn’t make sense to include all the files for RxSwift in every single project for each chapter in the book download.

Before you start working on this tutorial, make sure you have the latest version of CocoaPods installed. You need to do that just once before starting to work on this tutorial or any of the book’s projects. Usually executing this in Terminal will suffice:

sudo gem install cocoapods

If you want to know more, visit the CocoaPods website.

Then follow these steps:

  1. Download the exercise files for this tutorial if you haven’t already.
  2. Copy the starter folder in a convenient location on your computer. A location in your user folder is a good idea.
  3. Open the built-in Terminal.app or another one you use on daily basis and navigate to the starter folder. Type cd /users/yourname/path/to/starter, replacing the example path with the actual path on your computer.
  4. Type pod install to fetch RxSwift from GitHub and install it in the chapter project.
  5. Finally, inside the starter folder, find the newly created .xcworkspace file and launch it. Build the workspace one time in Xcode, and you’re ready to work through the chapter!

I’ve updated the tutorial exercise files, starter, challenge, and final. Everything is set up and ready to go now. Sorry for the hassle everyone. Enjoy! :smile:

Thanks, Scott - got it working now.

1 Like

Scott thanks for great tutorial. After reading it I have a question, I want to take last flatMap value and print it after button press, how can I achieve it? I don’t see a way how to extract last value from map sequence …

If I understand your question correctly, if value is an array, just get its last property value. Otherwise, your observable needs to be one that replays, such at a ReplaySubject, BehaviorSubject, or Variable.

Hi. I have the pods installed but I get this error when trying to run…
“The file “RxSwiftPlayground” couldn’t be opened because you don’t have permission to view it.” Am I missing a step? Thanks! :slight_smile:

1 Like

Same issue here, any updates?

Have you done a clean and deleted derived data?

If you right-click on the playground file in Finder, what do you see for Sharing & Permissions?

Yes, I’ve done that but no luck, I was using Xcode 8.3.2, not sure if that makes a difference.

I solved it by manually open the .project file first.
It will ask you

“RxSwift” is a project downloaded from the Internet. Are you sure you want to open it?

Then I can build it successfully :slight_smile:

Opening the project file for chapter 11 doesn’t help.

@zboralski Can you be more specific about the issue you’re encountering?

Did you try these steps?

In case it’s a permission issue, also check out this post.

can you give a example of flatmap marble diagram, i realy can’t figure out the flatMap { $0.value * 10 }:grinning:

Hi @m_ster, are you asking for a different example than the one I used in the book, or for help to better understand how flatMap works?

getting the following error for challenge on xcode 9:
file:///Users/pauluhn/Rx/challenge/Challenge1-Finished/RxSwift.playground: error: Playground execution aborted: error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=EXC_I386_GPFLT).
The process has been left at the point where it was interrupted, use “thread return -x” to return to the state before expression evaluation.

This tutorial is more than six months old so questions are no longer supported at the moment for it. We will update it as soon as possible. Thank you! :]