Загрузка страницы

RxSwift in Practice - RWDevCon 2016 Live Tutorial Session - raywenderlich.com

RxSwift, and its companion framework RxCocoa, allow you to create reactive apps for iOS and macOS. Glancing upon some Rx code might be intimidating without a proper introduction but in this session we will start in Playgrounds, learn the core concepts, and then move on to building a real iOS application in Xcode. Just beware - you might like programming with RxSwift too much :]

---

About www.raywenderlich.com:

raywenderlich.com is a website focused on developing high quality programming tutorials. Our goal is to take the coolest and most challenging topics and make them easy for everyone to learn – so we can all make amazing apps.

We are also focused on developing a strong community. Our goal is to help each other reach our dreams through friendship and cooperation. As you can see below, a bunch of us have joined forces to make this happen: authors, editors, subject matter experts, app reviewers, and most importantly our amazing readers!

---

RxSwift and RxCocoa are part of the suite of ReactiveX (usually abbreviated to “Rx”) language tools that span multiple programming languages and platforms.

While ReactiveX started as part of the .NET/C# ecosystem, it has grown extremely popular with Rubyists, JavaScripters and particularly Java and Android developers.

RxSwift is a framework for interacting with the Swift programming language, while RxCocoa is a framework that helps make Cocoa APIs used in iOS and OS X easier to use with reactive techniques.
ReactiveX frameworks are designed to be helpful by providing a common vocabulary for certain tasks used repeatedly across different programming languages. This (theoretically) makes it easier to focus on the syntax of the language itself, rather than wasting time figuring out how to map a common task to each new language.

Observables and Observers

Two concepts to be aware of for this tutorial are the Observable and the Observer.

An Observable is something which emits notifications of change.
An Observer is something which subscribes to an Observable, in order to be notified when it has changed.

You can have multiple Observers listening to an Observable. This means that when the Observable changes, it will notify all its Observers.

The DisposeBag

RxSwift and RxCocoa also have an additional tool to help deal with ARC and memory management: the DisposeBag. This is a virtual “bag” of Observer objects which are disposed of when their parent object is deallocated.

When deinit() is called on the object which has a DisposeBag as a property, the bag is “emptied” and each disposable Observer is automatically unsubscribed from what it was observing. This allows ARC to take back memory as it normally would.
Without a DisposeBag, you’d get one of two results: either the Observer would create a retain cycle, hanging on to what it’s observing indefinitely, or it could get deallocated out from under your object, causing a crash.

So to be a good ARC citizen, remember to add any Observable objects to the DisposeBag when you set them up. That way, they’ll be cleaned up nicely for you.

Видео RxSwift in Practice - RWDevCon 2016 Live Tutorial Session - raywenderlich.com канала raywenderlich.com
Показать
Комментарии отсутствуют
Введите заголовок:

Введите адрес ссылки:

Введите адрес видео с YouTube:

Зарегистрируйтесь или войдите с
Информация о видео
31 июля 2017 г. 19:19:07
01:14:12
Яндекс.Метрика