SlideShare a Scribd company logo
RX COCOA
권문범 / @MBKYLE
MASKKWON@GMAIL.COM
WHAT IS COCOA?
RX COCOA
RX SWIFT
COCOA
▸ Cocoa is….
RX SWIFT
COCOA
▸ Cocoa, which includes the
Foundation and AppKit
frameworks, is used for
developing applications that run
on macOS (OS X)
RX SWIFT
COCOA TOUCH
▸ Cocoa Touch, which includes the
Foundation and UIKit frameworks,
is used for developing
applications that run on iOS
BEGINNING
RX COCOA
RX SWIFT
HOW TO BINDING DATA
OBSERVABLE
SUBJECT
OBSERVER
STATE
OBSERVING
SUBSCRIBING
EMITTING ITEMS
DISPOSABLE
RESOURCE COUNTING
RX SWIFT
WHAT ARE OBSERVABLES
▸ The heart of Rx
▸ Rx : observable, observable sequence, sequence (same)
▸ Observables emits events (emit)
▸ Events can contain values or can be recognized gestures
RX SWIFT
HOW TO BINDING DATA
OBSERVABLE
SUBJECT
OBSERVER
STATE
OBSERVING
SUBSCRIBING
EMITTING ITEMS
DISPOSABLE
RESOURCE COUNTING
RX SWIFT
WHAT ARE SUBJECTS
▸ Subject is a sort of bridge or proxy that is available in some implementations of ReactiveX that act
both an observable and an observer
▸ PublishSubject - starts empty and only emits new elements to subscribers
▸ BehaviorSubject - starts with an initial value and replays it or the latest element to new subscriber
▸ ReplaySubject - initialized with a buffer size and will maintain a buffer of elements up to that size
and replay it to new subscribers
▸ Variable - wraps a BehaviorSubject, preserve its current value as state, and replays only the
latest/initial value to new subscribers
RX SWIFT
TRAITS
▸ Traits in general is an optional part of the framework, you are not forced to use
it.
▸ If you want some checks while compiling and nice restrictions when dealing
with the UI, these components are extremely powerful and time saving.
RX SWIFT
TRAITS
▸ ControlProperty : It is used to bind the data to the correct user interface
components using the rx extension.
▸ ControlEvent : It is used to listen to a certain event of the UI components.
▸ Driver : A special observable can’t error out. All processes are ensured to
execute on the main thread, which avoids making UI changes on background
threads.
RX SWIFT
CONTROL PROPERTY
RX SWIFT
CONTROL PROPERTY
VALUES
SUBJECT
OBSERVER
PROPERTY
OBSERVING
SUBSCRIBING
EMITTING ITEMS
DISPOSABLE
RESOURCE COUNTING
RX
CONTROL PROPERTY
RX SWIFT
CONTROL EVENT
EVENTS
SUBJECT
OBSERVER
EVENT
OBSERVING
SUBSCRIBING
EMITTING ITEMS
DISPOSABLE
RESOURCE COUNTING
RX
CONTROL EVENT
RX SWIFT
DRIVER
SOURCE
SUBJECT
OBSERVER
OBSERVED
OBSERVING
SUBSCRIBING
EMITTING ITEMS
DISPOSABLE
RESOURCE COUNTING
RX
DRIVER
MAIN SCHEDULER
RX SWIFT
UI BINDING OBSERVER
RX SWIFT
BINDING OBSERVABLES
▸ 데이터에 따른 UI 업데이트 트리거
▸ 데이터에 따른 background process 트리거
RX SWIFT
BIND TO
OBSERVABLE
SUBJECT
OBSERVER
OBSERVED
OBSERVING
BIND TO
EMITTING ITEMS
DISPOSABLE
RESOURCE COUNTING
PRODUCER
RECEIVER
RX SWIFT
DISPOSING WITH RX COCOA
▸ nothing : Inside singletons or a view controller which are never released.
▸ unowned : Inside all view controllers which are released after the closure task is
performed.
▸ weak : any other case.
RX SWIFT
UNOWNED
VIEWCONTROLLER
RX SWIFT
UNOWNED
VIEWCONTROLLER VIEWCONTROLLER
SUBSCRIBING
OBSERVABLE
CLOSURE
RX SWIFT
UNOWNED
VIEWCONTROLLER VIEWCONTROLLER
DISPOSING
OBSERVABLE
CLOSURE
RX SWIFT
UNOWNED
VIEWCONTROLLER VIEWCONTROLLER
DISPOSING
OBSERVABLE
CLOSURE
RX SWIFT
UNOWNED
VIEWCONTROLLER VIEWCONTROLLER
DISPOSING
OBSERVABLE
CLOSURE
NP
RX SWIFT
WEAK
VIEWCONTROLLER
RX SWIFT
WEAK
VIEWCONTROLLER VIEWCONTROLLER
OBSERVABLE
CLOSURE
SUBSCRIBING
RX SWIFT
WEAK
VIEWCONTROLLER VIEWCONTROLLER
OBSERVABLE
CLOSURE
SUBSCRIBING
RX SWIFT
WEAK
VIEWCONTROLLER VIEWCONTROLLER
OBSERVABLE
CLOSURE
WTF!!
THANK YOU
RX COCOA

More Related Content

DOCX
Architecture
PDF
Twelve Factor App
PPTX
Netflix Cloud Architecture and Open Source
PDF
Netflix Cloud Platform and Open Source
PDF
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
PPTX
Elastic Morocco Meetup Nov 2020
PDF
How to Design a Backend for IoT
PDF
Apache Samza 1.0 - What's New, What's Next
Architecture
Twelve Factor App
Netflix Cloud Architecture and Open Source
Netflix Cloud Platform and Open Source
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Elastic Morocco Meetup Nov 2020
How to Design a Backend for IoT
Apache Samza 1.0 - What's New, What's Next

Similar to [Rx] rx cocoa (20)

PDF
A sail in the cloud
PPTX
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
PPTX
Elasticsearch features and ecosystem
PPTX
Event Streaming Architectures with Confluent and ScyllaDB
PDF
Kubernetes Operators: Rob Szumski
PDF
Security Process in DevSecOps
PDF
Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...
PDF
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
PDF
Taste of RxJS
PDF
FIWARE Global Summit - Provisioning of the FIWARE Orion Context Broker using ...
PDF
Maxim Salnikov - Service Worker: taking the best from the past experience for...
PDF
Loadbalancers: The fabric for your micro services
PDF
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
PPTX
Akka Microservices Architecture And Design
PPTX
Event-driven Infrastructure - Mike Place, SaltStack - DevOpsDays Tel Aviv 2016
PDF
Framework Engineering
PDF
Technical Architecture of RASP Technology
PPTX
Pull, don’t push: Architectures for monitoring and configuration in a microse...
PPTX
Pull, Don't Push! Sensu Summit 2018 Talk
PDF
Cloud security : Automate or die
A sail in the cloud
Azure Service Fabric and the Actor Model: when did we forget Object Orientation?
Elasticsearch features and ecosystem
Event Streaming Architectures with Confluent and ScyllaDB
Kubernetes Operators: Rob Szumski
Security Process in DevSecOps
Two Years, Zero servers: Lessons learned from running a startup 100% on Serve...
Amazon EKS 그리고 Service Mesh (김세호 솔루션즈 아키텍트, AWS) :: Gaming on AWS 2018
Taste of RxJS
FIWARE Global Summit - Provisioning of the FIWARE Orion Context Broker using ...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Loadbalancers: The fabric for your micro services
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
Akka Microservices Architecture And Design
Event-driven Infrastructure - Mike Place, SaltStack - DevOpsDays Tel Aviv 2016
Framework Engineering
Technical Architecture of RASP Technology
Pull, don’t push: Architectures for monitoring and configuration in a microse...
Pull, Don't Push! Sensu Summit 2018 Talk
Cloud security : Automate or die
Ad

Recently uploaded (20)

PDF
Zenith AI: Advanced Artificial Intelligence
PDF
A novel scalable deep ensemble learning framework for big data classification...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
Architecture types and enterprise applications.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PDF
August Patch Tuesday
PDF
A contest of sentiment analysis: k-nearest neighbor versus neural network
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
A comparative study of natural language inference in Swahili using monolingua...
PDF
Getting Started with Data Integration: FME Form 101
PDF
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
PPTX
OMC Textile Division Presentation 2021.pptx
PPTX
O2C Customer Invoices to Receipt V15A.pptx
PPTX
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PPTX
The various Industrial Revolutions .pptx
PPTX
Tartificialntelligence_presentation.pptx
PDF
Univ-Connecticut-ChatGPT-Presentaion.pdf
Zenith AI: Advanced Artificial Intelligence
A novel scalable deep ensemble learning framework for big data classification...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Architecture types and enterprise applications.pdf
Programs and apps: productivity, graphics, security and other tools
Assigned Numbers - 2025 - Bluetooth® Document
Group 1 Presentation -Planning and Decision Making .pptx
August Patch Tuesday
A contest of sentiment analysis: k-nearest neighbor versus neural network
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A comparative study of natural language inference in Swahili using monolingua...
Getting Started with Data Integration: FME Form 101
DASA ADMISSION 2024_FirstRound_FirstRank_LastRank.pdf
OMC Textile Division Presentation 2021.pptx
O2C Customer Invoices to Receipt V15A.pptx
TechTalks-8-2019-Service-Management-ITIL-Refresh-ITIL-4-Framework-Supports-Ou...
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
The various Industrial Revolutions .pptx
Tartificialntelligence_presentation.pptx
Univ-Connecticut-ChatGPT-Presentaion.pdf
Ad

[Rx] rx cocoa