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
110
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
360
Apple HIG 正式名称クイズ結果発表 / HIG Quiz Result
usamik26
0
62
ゆめみ大技林製作委員会の立ち上げの話 / daigirin project
usamik26
0
250
@ViewLoadingプロパティラッパの紹介と自前で実装する方法 / @ViewLoading property wrapper implementation
usamik26
0
350
これからUICollectionViewを実践活用する人のためのガイド / Guide to UICollectionView
usamik26
1
600
Xcodeとの最近の付き合い方のはなし / Approach To Xcode
usamik26
2
520
UICollectionView Compositional Layout
usamik26
0
530
Coding Swift with Visual Studio Code and Docker
usamik26
0
330
Swift Extension for Visual Studio Code
usamik26
2
740
Other Decks in Programming
See All in Programming
GitHub Copilot Tips and Tricks
yuichielectric
26
7.4k
自動テスト実行結果の目的を整理する / Organizing objectives of automated test results
twada
PRO
10
2.1k
PHPでOfficeファイルを取り扱う! PHP Officeライブラリを プロダクトに組み込んだ話
hirobe1999
0
840
Crafting a Own PHP - ウキウキ手作りミニマリストPHP
uzulla
4
1.1k
Open Source Swiftc Workshop
kitasuke
1
180
Creating Retro-Style Photos Using Swift
ski
1
340
Learning PHP and Static Analysis with PHP Parser
inouehi
1
250
品質が高いコードって何?Rev2.1
ickx
1
490
両面どころかインフラもTSでできるよ ~ 全方位TypeScriptによるプロダクト開発 ~
myfinder
8
2.2k
DDD, necessary but insufficient: physical design principles for microservices
cer
PRO
0
2.2k
PHP 8.3で追加されたjson_validate()を徹底的に深掘りしてみよう
mashirou1234
1
720
イベントストーミングによるオブジェクトモデリング・オブジェクト指向プログラミングの適用・開発プロセスの変遷・アーキテクチャの変革 / Object modeling with Event Storming.
nrslib
12
3k
Featured
See All Featured
Building Your Own Lightsaber
phodgson
97
5.6k
Large-scale JavaScript Application Architecture
addyosmani
501
110k
Building Applications with DynamoDB
mza
88
5.6k
Rebuilding a faster, lazier Slack
samanthasiow
72
8.2k
The Cost Of JavaScript in 2023
addyosmani
13
3.7k
Bash Introduction
62gerente
604
210k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
19
1.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
501
140k
Visualization
eitanlees
135
14k
BBQ
matthewcrist
78
8.7k
jQuery: Nuts, Bolts and Bling
dougneiner
57
7.1k
Raft: Consensus for Rubyists
vanstee
130
6.2k
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 ͓͢͢Ί