Before we dive into using RxSwift for our app. We should definitely ponder over the “why factor” for the same. Why do we need RxSwift and why not use the conventional method.
So, the major drawback with the conventional method is that we have to manually maintain states and operate the calling of update state functions leading to huge if-else ladders, switch cases, etc. To cut all this chaos, an angel 🧚🏻(RxSwift) descends from the heavens and takes us to the land of Reactive programming. (Sorry about that! The hidden poetess in me tends to peep out sometimes!🤣)
Firstly, What is the architecture for an app? An architecture is basically how you bring together the building blocks of your app i.e. the program files, code and it’s distribution, so it is well readable, understandable, logical, and most importantly modularly reusable.
This article will give you a good idea about “MV(X)” ios architectures majorly being MVC and MVVM.
MVC stands for Model View Controller. It has been one of the most popular as well as easy-to-understand architectures being used for developing iOS applications.
Cocoapods is a dependency manager which is used to include third-party libraries in iOS and mac projects. All the libraries that you want to include in your project are added in a Podfile and then we can simply run a pod command on the terminal to install the added dependencies in the podfile. When installing, the libraries are downloaded and linked to an Xcode workspace which then onwards is used to move further with the project.
Before diving right into the article, let’s get a brief idea of what is reactive programming.
Reactive programming basically means relying on entities emitting elements, subscribing to its changes and reacting to those changes. So, reactive programming saves you from having to re-check states and manually putting conditions in your code. It remarkably reduces the code lines and makes the code cleaner and easier to manage. Most importantly, it manages asynchronous code execution in a very elegant manner owing to its observable-subscriber method.
This article will give you a quick skim of elements of Reactive programming in just 4 min…
iOS developer, content creator, music enthusiast ✨✨💫💫