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
120
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
devxoul
10
3.2k
좋은 디자이너, 나쁜 프로젝트매니저, 이상한 개발자
devxoul
0
100
Other Decks in Programming
See All in Programming
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
140
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
240
見せてあげますよ、「本物のLaravel批判」ってやつを。
77web
5
6.1k
C#/.NETのこれまでのふりかえり
tomokusaba
1
180
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
300
Jakarta Concurrencyによる並行処理プログラミングの始め方 (JJUG CCC 2024 Fall)
tnagao7
1
270
Importmapを使ったJavaScriptの 読み込みとブラウザアドオンの影響
swamp09
4
1.3k
約9000個の自動テストの 時間を50分->10分に短縮 Flakyテストを1%以下に抑えた話
hatsu38
24
12k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
640
ActiveSupport::Notifications supporting instrumentation of Rails apps with OpenTelemetry
ymtdzzz
1
180
광고 소재 심사 과정에 AI를 도입하여 광고 서비스 생산성 향상시키기
kakao
PRO
0
160
僕がつくった48個のWebサービス達
yusukebe
20
17k
Featured
See All Featured
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Building Applications with DynamoDB
mza
90
6.1k
Thoughts on Productivity
jonyablonski
67
4.3k
Building a Scalable Design System with Sketch
lauravandoore
459
33k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
The Cost Of JavaScript in 2023
addyosmani
45
6.7k
4 Signs Your Business is Dying
shpigford
180
21k
Faster Mobile Websites
deanohume
305
30k
How GitHub (no longer) Works
holman
310
140k
Ruby is Unlike a Banana
tanoku
96
11k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
360
Raft: Consensus for Rubyists
vanstee
136
6.6k
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)