Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ReactiveCocoa
Search
nghialv
December 14, 2015
Education
860
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ReactiveCocoa
nghialv
December 14, 2015
More Decks by nghialv
See All by nghialv
How LLMs Actually Work
nghialv
0
23
Presentation for CA.go
nghialv
0
130
A consistent delivery process with GitOps style for any application on any platform
nghialv
0
550
How it works - 1.1 - What happens when you run kubectl apply command
nghialv
0
1.1k
Why and how we build a unified CD system
nghialv
0
370
PipeCD at CyberAgent
nghialv
2
1.2k
Introdution_to_PipeCD.pdf
nghialv
2
750
The Journey of Software Delivery
nghialv
4
470
Monitoring at AbemaTV
nghialv
18
12k
Other Decks in Education
See All in Education
良い塩梅を実現する、AWSネットワーク3分クッキング
masakiokuda
1
260
[2026前期火5] 論理学(京都大学文学部 前期 第8回)「正規化定理の証明」
yatabe
0
160
2026年度春学期 統計学 第4回 データを「分布」で見る (2026. 4. 30)
akiraasano
PRO
0
140
AI時代に、 なぜ英語を勉強するのか
empelt
0
110
Case Studies and Future Research - Lecture 12 - Next Generation User Interfaces (4018166FNR)
signer
PRO
0
180
勾配ブースティングと決定木の話 / gradient boosting and decision trees
kaityo256
PRO
6
1.3k
Case Studies - Lecture 12 - Information Visualisation (4019538FNR)
signer
PRO
0
150
Soluciones al examen de Geografía 2026. JUNIO (Convocatoria Ordinaria)
juanmartin2026
0
4.1k
2026年度春学期 統計学 第3回 クロス集計と感度・特異度,データの可視化 (2026. 4. 23)
akiraasano
PRO
0
150
면접관 눈에 띄는 데이터 분석 포트폴리오 만드는 법 | 2026년 5월 세미나
datarian
0
740
From Days to Minutes: How We Taught an AI to Onboard 50+ Tenants on our AI Features
mfcabrera
0
180
Throw Yourself In! - How I've learned English and What I'm Facing
georgeorge
1
140
Featured
See All Featured
Exploring anti-patterns in Rails
aemeredith
3
410
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
WENDY [Excerpt]
tessaabrams
11
38k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.7k
Navigating Team Friction
lara
192
16k
A Soul's Torment
seathinner
6
3k
How to build a perfect <img>
jonoalderson
1
5.7k
BBQ
matthewcrist
89
10k
KATA
mclloyd
PRO
35
15k
How to Ace a Technical Interview
jacobian
281
24k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.8k
Transcript
5ͰReactiveCocoa TechLTձ2015
• Le Van Nghia (ΪΞ) • @nghialv (twitter: nghialv2607) ΞΧϯτ
• CyberAgentʹ৽ଔೖࣾ • FRESH!ੜ์ૹ , AmebaΞϓϦ
“2015ٕज़తʹมԽͷଟ͍1Ͱͨ͠Ͷ” Πϕϯτ֓ཁΑΓ
ٕज़ؔͳ͍Ͱ͕͢ɼCyberAgentͷϩΰมԽ͞Ε·ͨ͠ɻ
http://abema.tv https://amebafresh.tv Coming Soon!
• ϓϩδΣΫτϝϯόʔ30໊ • αʔόʔ & Πϯϑϥ x 6 • Go
1.5.2, Docker 1.9.0, AWS, Microservices, RESTful API (goji) • ϑϩϯτ x 6 • Node.js v4, TypeScript 1.6, React/Flux, SPA + SSR • iOS x 4 • Swift 2.1, ReactiveCocoa, MVVM • Android x 4 • Kotlin, Rx • σβΠφʔ x 3 • Sketch • πʔϧ • Slack + Hubot(ChatOps), Github Enterprise, CircleCI (Enterprise), Fabric, JIRA Agile, Mackerel…
speakerdeck.com/stormcat24/next-fresh-applications-with-amazon-ecs ࢁా͞Μ @stormcat24
2015ͷiOS։ൃ WWDC 2014 1.0 - closure, first-class functions - type
safety and type inference - generics - tuples and multiple return values - seamless access to Objective C, C, C++ 2/2015 1.2 - incremental builds - faster executables - better compiler diagnostics - stability improvements 9/2015 2.0 - error handling model - guard, defer - protocol extension - protocol-oriented programming - ίϯύΠϧ࣌ؒ - ίϯύΠϥͷόά AmebaΞϓϦ FRESH!ੜ์ૹ - ReactiveCocoa - MVVMϞσϧ 1.0ಋೖ - ίϯύΠϧ࣌ؒ - ֎෦ϥΠϒϥϦͷෆ҆ఆ ίʔυ͕ଟ͘ͳͬͨ࣌ - 100% Swift 1.2 - MVCϞσϧ - Future - Result
2015ͷiOS։ൃ 12/2015 Open source - source code - swift package
manager - core libraries - ports for Linux Fall 2016 3.0 FRESH!ੜ์ૹ - Swift2.0ʹҠಈ - ίϯύΠϧ͘ͳͬͨ
ReactiveCocoaͷλΠϜ
ReactiveCocoa (RAC) is a Cocoa framework inspired by Functional Reactive
Programming. It provides APIs for composing and transforming streams of values over time.
ReactiveCocoa (RAC) is a Cocoa framework inspired by Functional Reactive
Programming. It provides APIs for composing and transforming streams of values over time.
ReactiveCocoa (RAC) is a Cocoa framework inspired by Functional Reactive
Programming. It provides APIs for composing and transforming streams of values over time.
None
water pipe event pipe
event signal observe sink
event signal observe sink let (signal, sink) = Signal<String, ErrorType>.pipe()
signal .observe { event in // hi } sink.sendNext("hi")
event signal observe sink observe let (signal, sink) = Signal<String,
ErrorType>.pipe() signal .observe { event in // hi } sink.sendNext("hi") signal .observe { event in // hi }
event signal observe sink observe observe͢ΔલͷeventΛड͚औΕͳ͍
ReactiveCocoa (RAC) is a Cocoa framework inspired by Functional Reactive
Programming. It provides APIs for composing and transforming streams of values over time.
event signal observe sink transform
event signal observe sink let (signal, sink) = Signal<String, ErrorType>.pipe()
signal .map { string in string.uppercaseString } .observe { event in // “HI" } sink.sendNext("hi") transform hi HI
event observe sink
throttle event signal observe sink throttle let (signal, sink) =
Signal<Int, ErrorType>.pipe() signal .throttle(0.5, onScheduler: QueueScheduler()) .observe { num in // 1 // 4 } sink.sendNext(1) sink.sendNext(2) sink.sendNext(3) // after 0.5 second sink.sendNext(4)
combinePrevious let (signal, sink) = Signal<Int, ErrorType>.pipe() signal .combinePrevious(0) .observe
{ pre, cur in // pre = 0, cur = 1 // pre = 1, cur = 2 } sink.sendNext(1) sink.sendNext(2)
Transforming • map • filter • reduce • collect •
mapError • observeOn • ignoreNil • timeoutWithError • take • delay • skip • takeUntil • combinePrevious • takeLast • throttle • promoteErrors
ReactiveCocoa (RAC) is a Cocoa framework inspired by Functional Reactive
Programming. It provides APIs for composing and transforming streams of values over time.
• compose <A, B, C> (A -> B, B ->
C) -> A -> C f1: A -> B f2: B -> C f3: C -> D f = f1ɾf2ɾf3 => f: A -> D
Signal, TransformΛΈ߹Θͤͯɼ ผͷSignalΛߏͰ͖Δ
event signal observe sink transform transform ࿈ଓͰTransformΛΈ߹ΘͤΔ
observe ෳSignalΛΈ߹ΘͤΔ
͜ΕͰ͖ΔΑʂ
zip let (numbersSignal, numbersSink) = Signal<Int, NoError>.pipe() let (lettersSignal, lettersSink)
= Signal<String, NoError>.pipe() let newSignal = zip(numbersSignal, lettersSignal) newSignal .observe { event in println(event) } numbersSink.sendNext(1) // nothing printed lettersSink.sendNext("A") // prints (1, A) numbersSink.sendNext(2) // nothing printed lettersSink.sendNext("B") // prints (1, B) lettersSink.sendNext("C") // nothing printed lettersSink.sendNext("D") // nothing printed
Ͳͷͱ͜Ζʹ͑Δ?
• શ෦ • Model • ViewModel • View • Manager
• Api • …
͝ࢹௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ