Book Image

Reactive Programming with Swift

By : Cecil Costa
Book Image

Reactive Programming with Swift

By: Cecil Costa

Overview of this book

<p><span id="description" class="sugar_field">Reactive programming helps you write applications that are more powerful and efficient. You can write more software, help more people, and create applications that scale. Reactive programming is a growing paradigm that we will help you set to work in Swift.</span></p> <p><span class="sugar_field"><span id="description" class="sugar_field"> Reactive Programming with Swift guides you through migrating from the traditional way of developing to the new ReactiveCocoa framework, which uses Swift as its main programming language. You will learn how to develop with this framework, debug code, create unit tests, use additional frameworks, and convert a traditional framework into a ReactiveCocoa one.</span></span></p> <p><span class="sugar_field"><span id="description" class="sugar_field"><span id="description" class="sugar_field"> Starting with a crash course on the fundamental concepts of Reactive programming, we’ll set you up so you’re ready to create reactive applications. We’ll then move on to topics such as Graphical events, Streaming, and Core data, which will help you dive deeper with advanced programming. The concept of switching your programming concepts from imperative to functional reactive programming will also be covered. By the end of this book, you will be able to successfully create highly functional apps using Swift.</span> </span></span></p>
Table of Contents (14 chapters)
Reactive Programming with Swift
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface

Using Playground


Since Swift was released, Xcode comes with a feature called Playground. This is used to test Swift code in real time in a way that allows you to see the results without the need to execute the whole application.

The advantage of using Playground is that it is much faster to test than if you create new applications or unit tests when you have small tasks, such as testing the result of a signal or mutable property.

In this section, we are going to use Playground to test the ReactiveCocoa framework.

Start by creating a new Single View Application called RAC Playground. As usual, check whether Swift is the main programming language for this project:

Choose your favorite way of installing ReactiveCocoa and then install it (time to practice!). Once everything is done, select the ReactiveCocoa project from Project Navigator (not your application), and add a playground to it by using the commandN shortcut in order to add a new file. When the dialog requesting you to choose a template...