The learning materials list for RxSwift

Reactive programming is awesome and really makes complex I/O stuff simple. However, FRP is totally different approach how you look at the events and programming. Such a change in thinking requires good quality materials which can make the learning process simpler and quicker. Here’s the list of materials which I’ve read and I’ve found them useful. The list is sorted in an order I would like to read it 😉

Last update: 15.07.2017

I thought I would update the Top List. Since the publish date few nice articles have come out. So, here you have – the updated materials list for RxSwift. Enjoy reading 📚💪


Continue Reading

Memory management in RxSwift – DisposeBag

I’ve noticed a lot of beginners in RxSwift ask about DisposeBag. DisposeBag isn’t a standard thing in iOS development neither in other Rx’s implementations. Basically, it is how RxSwift handles memory management on iOS platform.

In this article, I want to answer for few question like what is the DisposeBag, Disposable and to talk generally about ARC memory management with RxSwift and how to protect yourself from memory leaks while using RxSwift. I hope you will enjoy it 📚💪


Continue Reading

Top mistakes in RxSwift you want to avoid

When we learn a new programming language or new frameworks we always do some mistakes. This is how we people learn things.

In this article, I’m want to show you my top 7 mistakes which I did during my Rx trials. I hope I will help you to avoid them 🙂.


Continue Reading

RxCaseStudy:
Default value after a countdown

Recently somebody asked me how he can send a default value if the stream hasn’t sent a new value in 5 minutes using RxSwift.

The final solution is short, however it uses few operators like merge, concat & flatMapLatest together which makes it more … advanced usage of Rx.

I thought it would be a great case-study for an article. So here it is! Enjoy reading 📚💪


Continue Reading

Combining Observables: combineLatest, withLatestFrom, zip

When it comes to writing an application in the reactive way, sooner or later your output will depend on more than just one Observable sequence. ReactiveX offers multiple operators to combine multiple Observables into one sequence.

Today I’ll describe what are the differences between combineLatest, withLatestFrom, zip and what are good scenarios to use them. Enjoy reading 💪📚


Continue Reading

Creating an Observable: create, just, deferred

RxSwiftCommunity is great and has already developed great Rx wrappers for existing API in iOS/mac world. However, you will always find a library or framework which doesn’t have Rx extension yet.

ReactiveX offers you 3 operators which you can use to wrap not-reactive code within an Observable. These operators are:

  • create()
  • just()
  • deferred()

What is the difference between them and when you should use which? These are the questions which I want to answer for. Enjoy reading 📚💪


Continue Reading

RxSwift: Reactive Programming with Swift
The book review

The last Friday evening and the whole weekend I spent with the first book about RxSwift. It took a couple of months to prepare the book for four authors however, it took me 2 days to read it 😅. What I’ve found in this book? Who will take the most advantage of reading it? Is it worth reading? This is my personal, subjective and honest opinion about it. Enjoy! 📚


Continue Reading

How to handle errors in RxSwift

In recent days MVVM become very popular architecture design for iOS apps. Especially when RxSwift starts to gain more and more popularity. In RxMVVM most of properties are expressed by Observables.

However, Observables terminate whenever they receive error or completed events. Termination means an Observable subscription won’t receive any new message. When I started to learn Rx I didn’t realize the consequences of this rule.

Do you have problems with errors handling? Did your Observable terminate unexpectedly and your button stopped sending tap events? This is what the article is about. Enjoy reading 📚💪


Continue Reading

RxTest – How to test the Observable in Swift

Few articles earlier I showed you how you can wrap presentation of UIAlertController with the Observable. Despite there weren’t any tests in the sample project, I’ve written the whole sample in TDD. I didn’t upload test files for the last time because I didn’t want to overload you 😃.

No matter how much RxSwift simplifies writing a code you should always write unit-tests. The feedback which tests provide is huge for the business and even for you because tests help you in revealing bad code smells in your architecture.

In this article, I want to show you all the tests I’ve written and how you can test the Observables with RxTest. Enjoy reading 📚💪


Continue Reading

Presenting the UIAlertController with RxSwift

Showing an action sheet seems not to be a typical use case for the Observable. My first implementation ended with multiple PublishSubject inside UIViewController and ViewModel. Multiple subscriptions inside Observable’s chain is usually a code smell. Of course, I didn’t have multiple subscribe method calls inside my code, but only a few bindings with bindTo. However, bindTo is just a wrapper over the subscribe method. In the end, I missed the sign of the code smell.

In this article, I want to show you how you can separate presentation of UIAlertController from the UIViewController. Moreover, I want to show you how to do implement it using the RxSwift.


Continue Reading