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
33
ReactorKit으로 단방향 반응형 앱 만들기
devxoul
0
130
Swift - 혼자 공부하면 분명히 안할테니까 같이 공부하기
devxoul
10
3.2k
좋은 디자이너, 나쁜 프로젝트매니저, 이상한 개발자
devxoul
0
100
Other Decks in Programming
See All in Programming
ErdMap: Thinking about a map for Rails applications
makicamel
1
910
rails newと同時に型を書く
aki19035vc
6
730
GitHub CopilotでTypeScriptの コード生成するワザップ
starfish719
28
6.1k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
440
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
770
2,500万ユーザーを支えるSREチームの6年間のスクラムのカイゼン
honmarkhunt
6
3.5k
Immutable ActiveRecord
megane42
0
110
Оптимизируем производительность блока Казначейство
lamodatech
0
980
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
190
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
130
shadcn/uiを使ってReactでの開発を加速させよう!
lef237
0
370
Featured
See All Featured
Writing Fast Ruby
sferik
628
61k
A Philosophy of Restraint
colly
203
16k
How to Ace a Technical Interview
jacobian
276
23k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
27
1.9k
RailsConf 2023
tenderlove
29
980
Building Applications with DynamoDB
mza
93
6.2k
What's in a price? How to price your products and services
michaelherold
244
12k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.3k
The Cult of Friendly URLs
andyhume
78
6.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.4k
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)