Book Image

Reactive Programming with Swift 4

By : Navdeep Singh
Book Image

Reactive Programming with Swift 4

By: Navdeep Singh

Overview of this book

RxSwift belongs to a large family of Rx implementations in different programming languages that share almost identical syntax and semantics. Reactive approach will help you to write clean, cohesive, resilient, scalable, and maintainable code with highly configurable behavior. This book will introduce you to the world of reactive programming, primarily focusing on mobile platforms. It will tell how you can benefit from using RxSwift in your projects, existing or new. Further on, the book will demonstrate the unbelievable ease of configuring asynchronous behavior and other aspects of the app that are traditionally considered to be hard to implement and maintain. It will explain what Rx is made of, and how to switch to reactive way of thinking to get the most out of it. Also, test production code using RxTest and the red/ green approach. Finally, the book will dive into real-world recipes and show you how to build a real-world app by applying the reactive paradigm. By the end of the book, you’ll be able to build a reactive swift application by leveraging all the concepts this book takes you through.
Table of Contents (15 chapters)
Free Chapter
1
Migrating from Swift 3 to Swift 4
2
FRP Fundamentals, Terminology, and Basic Building Blocks
3
Set up RxSwift and Convert a Basic Login App to its RxSwift Counterpart
8
RxTest and Custom Rx Extensions – Testing with Rx
10
Schedule Your Tasks, Don't Queue!
11
Subscribe to Errors and Save Your App
12
Functional and Reactive App-Architecture

Migrating from Swift 3 to Swift 4

This book aims to build on your current iOS development knowledge in Swift and gradually increase your Swift skills to master Reactive programming concepts in Swift. This book will guide you through the concepts while working with real-world apps and projects to give you a better understanding of RxSwift and related APIs.

Swift, as a programming language, has evolved many times over the years since its launch in 2014, and like any software update, we developers have to keep ourselves updated as well. We will start this book by giving you a hands-on update about what's new in Swift and how you can seamlessly migrate from your Swift 3 code to the latest Swift 4 syntax. You will then learn about Swift 4's new features and enhancements—from improvements in language syntax to the new protocols and APIs.

We will start with compatible Xcode IDE and how you can set up the environment required to work with the latest Swift release, some prerequisites before starting to migrate to the latest version, premigration preparation, things to do once the migration is complete, special cases, and other related stuff as we go through this chapter.

Unlike previous Swift releases, this release provides source compatibility with Swift 3 while working toward ABI stability. The main topics that will be covered in this chapter are as listed:

  • Setting up the Swift 4 environment
  • Changes/improvements to Swift
  • Additions to Swift
  • Migrating to Swift 4