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
RxSwift
Search
USAMI Kosuke
August 26, 2015
Programming
0
130
RxSwift
http://kanmoba.connpass.com/event/18762/
USAMI Kosuke
August 26, 2015
Tweet
Share
More Decks by USAMI Kosuke
See All by USAMI Kosuke
Onsager代数とその周辺 / Onsager algebra tsudoi
usamik26
0
600
Apple HIG 正式名称クイズ結果発表 / HIG Quiz Result
usamik26
0
160
ゆめみ大技林製作委員会の立ち上げの話 / daigirin project
usamik26
0
310
@ViewLoadingプロパティラッパの紹介と自前で実装する方法 / @ViewLoading property wrapper implementation
usamik26
0
460
これからUICollectionViewを実践活用する人のためのガイド / Guide to UICollectionView
usamik26
1
720
Xcodeとの最近の付き合い方のはなし / Approach To Xcode
usamik26
2
650
UICollectionView Compositional Layout
usamik26
0
750
Coding Swift with Visual Studio Code and Docker
usamik26
0
490
Swift Extension for Visual Studio Code
usamik26
2
1k
Other Decks in Programming
See All in Programming
ローコードサービスの進化のためのモノレポ移行
taro28
1
330
MCP世界への招待: AIエンジニアが創る次世代エージェント連携の世界
gunta
2
430
NestJSのコードからOpenAPIを自動生成する際の最適解を探す
astatsuya
0
160
ニックトレイン登壇資料
ryotakurokawa
0
130
2025/3/18 サービスの成長で生じる幅広いパフォーマンスの問題を、 AIで手軽に解決する
shirahama_x
0
160
CRE Meetup!ユーザー信頼性を支えるエンジニアリング実践例の発表資料です
tmnb
0
150
Devin入門と最近のアップデートから見るDevinの進化 / Introduction to Devin and the Evolution of Devin as Seen in Recent Update
rkaga
7
3.2k
requirements with math
moony
0
510
Devinのメモリ活用の学びを自社サービスにどう組み込むか?
itarutomy
0
1.4k
PHPer's Guide to Daemon Crafting Taming and Summoning
uzulla
2
840
OpenTelemetryを活用したObservability入門 / Introduction to Observability with OpenTelemetry
seike460
PRO
0
200
プログラミング教育のコスパの話
superkinoko
0
110
Featured
See All Featured
For a Future-Friendly Web
brad_frost
176
9.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Rails Girls Zürich Keynote
gr2m
94
13k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
The World Runs on Bad Software
bkeepers
PRO
67
11k
Fireside Chat
paigeccino
37
3.3k
Bash Introduction
62gerente
611
210k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
How STYLIGHT went responsive
nonsquared
99
5.4k
A better future with KSS
kneath
238
17k
Transcript
RxSwift
About me 4 Ӊࠤݟ ެี (@usamik26) 4 ϑΣϯϦϧגࣜձࣾ 4 iOS
ΞϓϦΤϯδχΞ 4 0x29ࡀʹͳΓ·ͨ͠
Reactive Programming
Reactive Programming 4 ΠϕϯτͷؔੑʢσʔλϑϩʔʣΛهड़ 4 ͦͷهड़ͰɺҰํͷมԽΛଞํʹ 4 ϝοηʔδૹ৴͕Ӆṭ͞ΕΔ 4 σʔλόΠϯσΟϯά
Reactive ͳΈͱ͍͑Δ
Functional Reactive Programming 4 ඇಉظσʔλετϦʔϜ 4 ࣌ؒ࣠ʹԊ͕ͬͯྲྀΕΔϦετ 4 ετϦʔϜʹର͢ΔϦετૢ࡞ 4
map filter ͱ͍ͬͨؔܕͷΠσΟΦϜ
RP / FRP ͷར 4 Πϕϯτۦಈॲཧ͕ॻ͖͍͢ 4 ඇಉظॲཧ͕ॻ͖͍͢ 4 GUI
ϓϩάϥϛϯάͱ૬ੑ͕ྑ͍
Reactive Programming for iOS
Reactive Programming for iOS 4 ReactiveCocoa 4 ReactKit 4 RxSwift
4 ͻͱͪ͘ʹ Reactive ͱ͍ͬͯߟ͑ํ͕ͪΐͬͱͣͭҧ ͏ 4 ͦΕͧΕʹྑ͕͋͞Δ
RxSwift
RxSwift ͷಛ 4 ReactiveX ϑΝϛϦʔ 4 ࠷ۙਖ਼ࣜʹՃΘͬͨ 4 Swift ωΠςΟϒ
4 ίΞʢRxSwiftʣ Swift ͷΈ 4 Ұ෦ʢRxCocoaʣ Objective-C ΛؚΉ
ReactiveX 4 http://reactivex.io 4 ֤ݴޠ൛͕͋Δ 4 Rx.NET (C#) 4 RxJava
4 RxJS 4 RxSwift 4 ɾɾɾͳͲ 4 Learn once, apply anywhere
RxSwift ͷಋೖ 4 Dynamic Library ͱͯ͠ಋೖʢiOS 8 Ҏ߱ʣ 4 CocoaPods
4 Carthage 4 ϓϩδΣΫτʹΈࠐΈʢiOS 7 ରԠʣ 4 CocoaSeeds
RxSwift / RxCocoa 4 RxSwift 4 Observable / ֤छ Operator
/ Scheduler ͳͲ 4 RxCocoa 4 UIKit / NSURLSession / KVO ͳͲ
Examples
Examples 4 ҎԼΛݟΔͱΑ͍ 4 README 4 RxExample ϓϩδΣΫτ
Examples 1 combineLatest(firstNameLabel.rx_text, lastNameLabel.rx_text) { $0 + " " +
$1 } >- map { "Greeting \($0)" } >- subscribeNext { greeting in greetingLabel.text = greeting }
Examples 2 let userRequest: Observable<User> = API.getUser("me") let friendsRequest: Observable<[Friend]>
= API.getFriends("me") zip(userRequest, friendsRequest) { user, friends in return (user, friends) } >- observeOn(MainScheduler.sharedInstance) >- subscribeNext { (user, friends) in // bind to UI }
Examples 3 searchTextField.rx_text >- throttle(0.5, MainScheduler.sharedInstance) >- distinctUntilChanged() >- map
{ query in API.getSearchResults(query) >- retry(3) >- startWith([]) >- catchError([]) } >- switchLatest >- map { results in // bind to UI }
Documents 4 ReactiveX ຊՈ͕͔Γ͍͢ 4 http://reactivex.io 4 RxSwift 4 Documentation/API.md
ͳͲ
RxSwift 2.0
RxSwift 2.0 4 ݱࡏ։ൃதʢGit ϒϥϯν rxswift-2.0ʣ 4 Swift 2 ରԠ
4 ԋࢉࢠ͕ >- ͔Β . ʹมߋ 4 ෦ϩδοΫ : RxResult ͔Β try - catch ʹ
RxSwift ͓͢͢Ί