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
Suyeol Jeon
October 27, 2017
Programming
1
350
RxSwift 시작하기
https://www.slideshare.net/devxoul/rxswift-81314827
Suyeol Jeon
October 27, 2017
Tweet
Share
More Decks by Suyeol Jeon
See All by Suyeol Jeon
성장하는 iOS 개발자 되기
devxoul
2
230
레거시 프로젝트에서 의존성 주입하기
devxoul
1
2.3k
Let's TDD
devxoul
0
70
Hello, ReactorKit 👋
devxoul
0
84
Build Funnels with Google BigQuery
devxoul
0
32
ReactorKit으로 단방향 반응형 앱 만들기
devxoul
0
130
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
devxoul
10
3.2k
좋은 디자이너, 나쁜 프로젝트매니저, 이상한 개발자
devxoul
0
100
Other Decks in Programming
See All in Programming
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
350
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
CSC509 Lecture 13
javiergs
PRO
0
110
Remix on Hono on Cloudflare Workers
yusukebe
1
310
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
Functional Event Sourcing using Sekiban
tomohisa
0
110
C++でシェーダを書く
fadis
6
4.1k
ヤプリ新卒SREの オンボーディング
masaki12
0
130
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.3k
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
260
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.3k
React CompilerとFine Grained Reactivityと宣言的UIのこれから / The next chapter of declarative UI
ssssota
1
120
Featured
See All Featured
Gamification - CAS2011
davidbonilla
80
5k
It's Worth the Effort
3n
183
27k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
27
4.3k
For a Future-Friendly Web
brad_frost
175
9.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
47
2.1k
Practical Orchestrator
shlominoach
186
10k
Adopting Sorbet at Scale
ufuk
73
9.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.8k
Git: the NoSQL Database
bkeepers
PRO
427
64k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
Code Review Best Practice
trishagee
64
17k
Transcript
RxSwift दೞӝ ࣻৌ (github.com/devxoul)
ࣻৌ • StyleShare Inc. • SW Maestro 2ӝ • RxSwift
RxSwift?
RxSwift = ReactiveX + Swift
RxSwift = ReactiveX + Swift
RxSwift = ReactiveX + Swift ?
RxSwift = ReactiveX + Swift Re + ActiveX
None
ইש
RxSwift = ReactiveX + Swift Reactive + Extension
RxSwift = ReactiveX + Swift ߈ഋ ۽Ӓې߁ਸ ೡ ࣻ ѱ
೧ח ഛಂ
RxSwift = ReactiveX + Swift ߈ഋ ۽Ӓې߁ਸ ೡ ࣻ ѱ
೧ח ഛಂ ?
a = 10 b = a * 2
a = 10 b = a * 2 print(b)
a = 10 b = a * 2 print(b) //
20
a = 10 b = a * 2 print(b) //
20 a = 30
a = 10 b = a * 2 print(b) //
20 a = 30 print(b)
a = 10 b = a * 2 print(b) //
20 a = 30 print(b) // 20
a = 10 b = a * 2 print(b) //
20 a = 30 print(b) // 20 60
߈ഋ ۽Ӓې߁ਸ ਤ೧ ReactiveXо ࢎਊೞח بҳ Observer Pattern Iterator Pattern
Functional Programming
߈ഋ ۽Ӓې߁ਸ ਤ೧ ReactiveXо ࢎਊೞח بҳ Observer Pattern Iterator Pattern
Functional Programming
Observable Observer
Observable Observer observe
Observable Observer observe notify
Observable Observer Observer Observer
߈ഋ ۽Ӓې߁ਸ ਤ೧ ReactiveXо ࢎਊೞח بҳ Observer Pattern Iterator Pattern
Functional Programming
Iterator next() hasNext()
Iterator next() hasNext() 10 20 30 40
Iterator next() hasNext() 10 20 30 40
Iterator next() hasNext() 10 20 30 40 iterator.next()
Iterator next() hasNext() 10 20 30 40 iterator.next() // 10
Iterator next() hasNext() 10 20 30 40
Iterator next() hasNext() 10 20 30 40 iterator.next()
Iterator next() hasNext() 10 20 30 40 iterator.next() // 20
Iterator next() hasNext() 10 20 30 40
Iterator next() hasNext() 10 20 30 40 iterator.next()
Iterator next() hasNext() 10 20 30 40 iterator.next() // 30
Iterator next() hasNext() 10 20 30 40
Iterator next() hasNext() 10 20 30 40 iterator.next()
Iterator next() hasNext() 10 20 30 40 iterator.next() // 40
Iterator next() hasNext() 10 20 30 40
Iterator next() hasNext() 10 20 30 40 iterator.hasNext() // false
߈ഋ ۽Ӓې߁ਸ ਤ೧ ReactiveXо ࢎਊೞח بҳ Observer Pattern Iterator Pattern
Functional Programming
• ࣻ ೣࣻ ઑਵ۽ ۽Ӓ۔ ҳࢿ • ࢚కܳ ߄Բ ঋҊ,
ࠛ߸ ܐഋ ࢎਊ ೣࣻഋ ۽Ӓې߁
• Ҋର ೣࣻ • ࣽࣻ ೣࣻ • ... ೣࣻഋ ۽Ӓې߁
higher-order fuction pure fuction
• Ҋର ೣࣻ • ࣽࣻ ೣࣻ • ... ೣࣻഋ ۽Ӓې߁
higher-order fuction pure fuction
Ҋର ೣࣻ 1. ೣࣻܳ ܲ ೣࣻ ۄఠ۽ ׳ 2. ೣࣻܳ
ܲ ೣࣻীࢲ Ѿҗ۽ ߈ജ
var array = [2, 6, 3, 1, 7] array.sort(by: {
a, b in return a < b })
var array = [2, 6, 3, 1, 7] array.sort(by: {
a, b in return a < b })
var array = [2, 6, 3, 1, 7] array.sort(by: {
a, b in return a < b })
• Ҋର ೣࣻ • ࣽࣻ ೣࣻ • ... ೣࣻഋ ۽Ӓې߁
higher-order fuction pure fuction
ࣽࣻ ೣࣻ • ࠗਊਸ ߊࢤदః ঋח ೣࣻ • ଵઑ ైݺࢿ
ח ೣࣻ
ࣽࣻ ೣࣻ • ࠗਊਸ ߊࢤदః ঋח ೣࣻ • ଵઑ ైݺࢿ
ח ೣࣻ ೣࣻ झܳ ߩযաࢲ ߄Ӵ ࣁ࢚ী ߸ചܳ оೞח ೯ز (࢚క ߸҃, ֎ਕఊ, I/O ١)
ࣽࣻ ೣࣻ • ࠗਊਸ ߊࢤदః ঋח ೣࣻ • ଵઑ ైݺࢿ
ח ೣࣻ ੑ۱ زੌೞݶ ۱ب ೦࢚ زੌ
var rate = 1130 func krw(usd: Int) -> Int {
return usd * rate }
var rate = 1130 func krw(usd: Int) -> Int {
return usd * rate } krw(usd: 2) // 2260 krw(usd: 3) // 3390
var rate = 1130 func krw(usd: Int) -> Int {
return usd * rate } rate = 1140 krw(usd: 2) // 2260 krw(usd: 3) // 3390
var rate = 1130 func krw(usd: Int) -> Int {
return usd * rate } rate = 1140 krw(usd: 2) // 2260 2280 krw(usd: 3) // 3390 3420
var rate = 1130 func krw(usd: Int) -> Int {
return usd * rate } ࢚కী ઓ rate = 1140 krw(usd: 2) // 2260 2280 krw(usd: 3) // 3390 3420
var rate = 1130 func krw(usd: Int) -> Int {
return usd * rate } ࢚కী ઓ rate = 1140 krw(usd: 2) // 2260 2280 krw(usd: 3) // 3390 3420 ଵઑ ైݺࢿ হ
func krw(usd: Int) -> Int { return usd * rate
}
func krw(usd: Int ) -> Int { return usd *
rate }
func krw(usd: Int, rate: Int) -> Int { return usd
* rate }
func krw(usd: Int, rate: Int) -> Int { return usd
* rate }
߈ഋ ۽Ӓې߁ਸ ਤ೧ ReactiveXо ࢎਊೞח بҳ Observable Pattern Iterator Pattern
Functional Programming
None
a 10 b a * 2
a 10 b 20
None
None
None
None
a b
10 20 30 40 a 20 40 60 80 b
10 20 30 40 a 20 40 60 80 b
10 20 30 40 a 20 40 60 80 b
map(x => x * 2)
10 20 30 40 a 20 40 60 80 b
map(x => x * 2) Marble Diagrams
20 40 60 80 b map(x => x * 2)
Observable.from([10, 20, 30, 40])
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) // 20 })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) // 40 })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) // 60 })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) // 80 })
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) // 80 }) Observable
Observable.from([10, 20, 30, 40]) .map { $0 * 2 }
.subscribe(onNext: { value in print(value) // 80 }) Observer
Password ࢜ ࠺ߣഐ ࢸೞӝ (4 ࢚)
1 ࢜ ࠺ߣഐ ࢸೞӝ (4 ࢚) ࠺ߣഐо ցޖ ૣणפ. ❌
12 ࢜ ࠺ߣഐ ࢸೞӝ (4 ࢚) ࠺ߣഐо ցޖ ૣणפ. ❌
123 ࢜ ࠺ߣഐ ࢸೞӝ (4 ࢚) ࠺ߣഐо ցޖ ૣणפ. ❌
1234 ࢜ ࠺ߣഐ ࢸೞӝ (4 ࢚) ࢎਊ оמೠ ࠺ߣഐੑפ.
ੑ۱ ݫद
ੑ۱ ݫद "1"
ੑ۱ ݫद "1" map(str => str.length >= 4)
ੑ۱ ݫद "1" map(str => str.length >= 4) false
"1" false map(str => str.length >= 4) map(valid => getMessage(valid))
ੑ۱ ݫद
"1" false map(str => str.length >= 4) "❌ " map(valid
=> getMessage(valid)) ੑ۱ ݫद
"1" "12" false map(str => str.length >= 4) "❌ "
map(valid => getMessage(valid)) ੑ۱ ݫद
"1" "12" false false map(str => str.length >= 4) "❌
" map(valid => getMessage(valid)) ੑ۱ ݫद
"1" "12" false false map(str => str.length >= 4) "❌
" "❌ " map(valid => getMessage(valid)) ੑ۱ ݫद
"1" "12" "123" false false map(str => str.length >= 4)
"❌ " "❌ " map(valid => getMessage(valid)) ੑ۱ ݫद
"1" "12" "123" false false false map(str => str.length >=
4) "❌ " "❌ " map(valid => getMessage(valid)) ੑ۱ ݫद
"1" "12" "123" false false false map(str => str.length >=
4) "❌ " "❌ " "❌ " map(valid => getMessage(valid)) ੑ۱ ݫद
"1" "12" "123" "1234" false false false map(str => str.length
>= 4) "❌ " "❌ " "❌ " map(valid => getMessage(valid)) ੑ۱ ݫद
"1" "12" "123" "1234" false false false true map(str =>
str.length >= 4) "❌ " "❌ " "❌ " map(valid => getMessage(valid)) ੑ۱ ݫद
false false false true map(str => str.length >= 4) map(valid
=> getMessage(valid)) "1" "12" "123" "1234" ੑ۱ "❌ " "❌ " "❌ " "" ݫद
passwordField.rx.text.orEmpty
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 }
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in }
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } }
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message })
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message }) "1"
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message }) false
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message })
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message })
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message }) "12"
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message }) false
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message })
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message })
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message }) "123"
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message }) false
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message })
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message })
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message }) "1234"
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message }) true
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message })
passwordField.rx.text.orEmpty .map { $0.characters.count >= 4 } .map { isValid
in if isValid { return "ࢎਊ оמೠ ࠺ߣഐੑפ. " } else { return "࠺ߣഐо ցޖ ૣणפ. ❌" } } .subscribe(onNext: { [weak self] message in self?.messageLabel.rx.text = message })
ࢎਊ ੋఠۑ࣌ਸ ؘఠ ܴਵ۽ അ оמ
ࢎਊ ੋఠۑ࣌ਸ ؘఠ ܴਵ۽ അ оמ Ӗ ੑ۱: Observable<String> ं
ੑ۱: Observable<Int> ߡౡ ఠ: Observable<Void> झ܀: Observable<CGPoint> ...
Observable ࠺زӝ झܿ
"1" "12" "123" "1234"
"1"
"1" ࠺زӝ
"1" "12" ࠺زӝ
"1" "12" ࠺زӝ ࠺زӝ
"1" "12" "123" ࠺زӝ ࠺زӝ
"1" "12" "123" ࠺زӝ ࠺زӝ ࠺زӝ
"1" "12" "123" "1234" ࠺زӝ ࠺زӝ ࠺زӝ
ࢎਊ ץ֎ ࢸೞӝ Nickname
݃ழߡӒ ࢎਊ ץ֎ ࢸೞӝ ࢎਊੋ ץ֎ੑפ. ❌
࠽ѱஎ ࢎਊ ץ֎ ࢸೞӝ ࢎਊੋ ץ֎ੑפ. ❌
ࣻৌ ࢎਊ ץ֎ ࢸೞӝ ࢎਊ оמೠ ץ֎ੑפ.
ץ֎ ࠂ ܳ ਤ೧ APIܳ ࢎਊ
ץ֎ ࠂ ܳ ਤ೧ APIܳ ࢎਊ = ࠺زӝ স
nicknameField.rx.text.orEmpty
nicknameField.rx.text.orEmpty .map { nickname -> Bool in // return true
of false }
࠺زӝ? nicknameField.rx.text.orEmpty .map { nickname -> Bool in // return
true of false }
nicknameField.rx.text.orEmpty . map { nickname -> Bool in }
nicknameField.rx.text.orEmpty .flatMap { nickname -> Observable<Bool> in }
nicknameField.rx.text.orEmpty .flatMap { nickname -> Observable<Bool> in return API.checkNickname(nickname) }
nicknameField.rx.text.orEmpty .flatMap { nickname -> Observable<Bool> in return API.checkNickname(nickname) }
.map { isAvailable in return getMessage(isAvailable) }
nicknameField.rx.text.orEmpty .flatMap { nickname -> Observable<Bool> in return API.checkNickname(nickname) }
.map { isAvailable in return getMessage(isAvailable) } .subscribe(onNext: { [weak self] message in self?.messageLabel.text = message })
map() vs flatMap() 20 40 60 80 map(x => x
* 2) 10 20 30 40
map() vs flatMap() flatMap( => )
map() vs flatMap() flatMap( => )
map() vs flatMap() flatMap( => )
map() vs flatMap() flatMap( => )
map() vs flatMap() flatMap( => )
map() vs flatMap() flatMap( => )
map() vs flatMap() flatMap( => )
map() vs flatMap() flatMap( => )
map() vs flatMap() flatMap( => )
map() vs flatMap() flatMap( => )
map() vs flatMap() flatMap( => )
ࢎਊ ץ֎ ࢸೞӝ Nickname
checkNickname("Ŷ") checkNickname("݃") checkNickname("⽃") checkNickname("݃") checkNickname("݃䄲") checkNickname("݃") checkNickname("݃㬌") checkNickname("݃ழ")
nicknameField.rx.text.orEmpty .flatMap { nickname -> Observable<Bool> in return API.checkNickname(nickname) }
.map { isAvailable in return getMessage(isAvailable) } .subscribe(onNext: { [weak self] message in self?.messageLabel.text = message })
nicknameField.rx.text.orEmpty .debounce(0.3, scheduler: MainScheduler.instance) .flatMap { nickname -> Observable<Bool> in
return API.checkNickname(nickname) } .map { isAvailable in return getMessage(isAvailable) } .subscribe(onNext: { [weak self] message in self?.messageLabel.text = message })
checkNickname("Ŷ") checkNickname("݃") checkNickname("⽃") checkNickname("݃") checkNickname("݃䄲") checkNickname("݃") checkNickname("݃㬌") checkNickname("݃ழ")
checkNickname("Ŷ") checkNickname("݃") checkNickname("⽃") checkNickname("݃") checkNickname("݃䄲") checkNickname("݃") checkNickname("݃㬌") checkNickname("݃ழ") 0.3s 0.3s
0.3s
checkNickname("Ŷ") checkNickname("݃") checkNickname("⽃") checkNickname("݃") checkNickname("݃䄲") checkNickname("݃") checkNickname("݃㬌") checkNickname("݃ழ") 0.3s 0.3s
0.3s
1 4 debounce 1 2 3 4
ࠂ೧ ࣻ ח ࢚క ҙܻо рѾ೧
ױ, Observable ࢤݺ ӝח ҙܻ
Timer 00:17
Timer 00:17 Observable<Int> .interval(1, scheduler: ...) .subscribe(onNext: { tick in
print(tick) })
Timer 00:17
Start
17 18 19 20 21 ... Start
Start ചݶ ࢎۄ݅ Observable ҅ࣘ ز
Timer 00:17 Observable<Int> .interval(1, scheduler: ...) .subscribe(onNext: { tick in
print(tick) })
Timer 00:17 var disposeBag = DisposeBag() Observable<Int> .interval(1, scheduler: ...)
.subscribe(onNext: { tick in print(tick) }) .disposed(by: disposeBag)
Timer 00:17 var disposeBag = DisposeBag() Observable<Int> .interval(1, scheduler: ...)
.subscribe(onNext: { tick in print(tick) }) .disposed(by: disposeBag)
var disposeBag = DisposeBag() Observable<Int> .interval(1, scheduler: ...) .subscribe(onNext: {
tick in print(tick) }) .disposed(by: disposeBag) Start
var disposeBag = DisposeBag() Observable<Int> .interval(1, scheduler: ...) .subscribe(onNext: {
tick in print(tick) }) .disposed(by: disposeBag) Start ݫݽܻীࢲ ೧ઁ
var disposeBag = DisposeBag() Observable<Int> .interval(1, scheduler: ...) .subscribe(onNext: {
tick in print(tick) }) .disposed(by: disposeBag) Start
var disposeBag = DisposeBag() Observable<Int> .interval(1, scheduler: ...) .subscribe(onNext: {
tick in print(tick) }) .disposed(by: disposeBag) Start Dispose
• ࢎਊ ੋఠۑ࣌ਸ ؘఠ ܴਵ۽ ܻ • ӈଳ ࢚క ҙܻܳ
ࣚऔѱ • ࠺زӝ ٘ܳ ాੌػ ߑधਵ۽ ࢎਊ RxSwift
http://reactivex.io http://rxswift.org http://community.rxswift.org https://rxswift-slack.herokuapp.com
хࢎפ. ࣻৌ (github.com/devxoul)