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
Serialize process with screen transitions.
Search
417.72KI
February 28, 2019
Technology
2
1.3k
Serialize process with screen transitions.
potatotips #59
417.72KI
February 28, 2019
Tweet
Share
More Decks by 417.72KI
See All by 417.72KI
iTunes・おぼえていますか〜ScriptingBridge今昔物語〜
417_72ki
1
23
The history of entry-point in iOS app Development
417_72ki
0
360
R.swift to Asset Symbols
417_72ki
0
250
Refactor with using `available` and `deprecated`
417_72ki
3
600
CLIツールにSwift Concurrencyを適用させようとしている話
417_72ki
3
390
CI with Danger-Swift
417_72ki
1
200
Graduation from Playground beginner
417_72ki
3
890
Trap Questions in Java and Obj-C
417_72ki
1
270
ダックタイピングとidでUserDefaultsをモック化する
417_72ki
2
2.5k
Other Decks in Technology
See All in Technology
[CV勉強会@関東 ECCV2024 読み会] オンラインマッピング x トラッキング MapTracker: Tracking with Strided Memory Fusion for Consistent Vector HD Mapping (Chen+, ECCV24)
abemii
0
220
【令和最新版】AWS Direct Connectと愉快なGWたちのおさらい
minorun365
PRO
5
750
BLADE: An Attempt to Automate Penetration Testing Using Autonomous AI Agents
bbrbbq
0
300
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
Introduction to Works of ML Engineer in LY Corporation
lycorp_recruit_jp
0
110
iOS/Androidで同じUI体験をネ イティブで作成する際に気をつ けたい落とし穴
fumiyasac0921
1
110
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
470
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
AGIについてChatGPTに聞いてみた
blueb
0
130
Adopting Jetpack Compose in Your Existing Project - GDG DevFest Bangkok 2024
akexorcist
0
110
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
2
590
Amazon CloudWatch Network Monitor のススメ
yuki_ink
1
200
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
89
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Designing for Performance
lara
604
68k
Documentation Writing (for coders)
carmenintech
65
4.4k
We Have a Design System, Now What?
morganepeng
50
7.2k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
Raft: Consensus for Rubyists
vanstee
136
6.6k
Typedesign – Prime Four
hannesfritz
40
2.4k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Done Done
chrislema
181
16k
Transcript
ը໘ભҠ͕བྷΉͷड͚͠Λ 3Y4XJGUͰྻԽͯ͠Έͨ !QPUBUPUJQT
struct Me { let name = "Takuhiro Muta" let aka
= "417.72KI" let experienceYears = 5 let company = "iRidge inc." let twitter = "417_72ki" let qiita = "417_72ki" let gitHub = "417-72KI" let like = [ "BEMANI", "Real Escape Game", "Bang Dream!", "LoveLive! Sunshine!!", "etc…" ] } TFMGEFTDSJQUJPO
͢͜ͱ w ՝ͱΞϓϩʔνྫ
͞ͳ͍͜ͱ w 3Y4XJGUʹ͍ͭͯ w Έͱ͔ܕͱ͔ w ֤छΞʔΩςΫνϟʹͲ͏ద༻͢Δ͔
ී௨ͷෳࡶͳॲཧϑϩʔ "ͱ௨৴͢Δ "ͷ݁ՌΛͬͯ#ͱ௨৴͢Δ #ͷ݁ՌΛͬͯ$ͱ௨৴͢Δ
ී௨ͷෳࡶͳॲཧϑϩʔ func connectA() -> Single<String> func connectB(resultOfA: String) -> Single<String>
func connectC(resultOfB: String) -> Single<String> func doSomething() { connectA() .flatMap(connectB) .flatMap(connectC) .subscribe(onSuccess: { // ࠷ऴ݁ՌͰԿ͔͢Δ }, onError: { print($0) }) .disposed(by: disposeBag) }
None
ࠓճͷ՝ ྫ "ͱ௨৴͢Δ "ͷ݁ՌΛ8FC7JFXʹૹͬͯ Ϣʔβʔʹૢ࡞ͤ͞Δ Ϣʔβʔ͕ૢ࡞ͨ݁͠ՌΛ ϑοΫͯ͠$ͱ௨৴͢Δ 8FC7JFX$POUSPMMFS QSFTFOU7JFX$POUSPMMFS 8FC7JFX%FMFHBUF
EJTNJTT7JFX$POUSPMMFS 8FC7JFX$POUSPMMFS %FMFHBUF
ࠓճͷ՝ ྫ func doSomething() { connectA() .subscribe(onSuccess: { [unowned self]
in let webView = // initialize WebViewController webView.delegate = self webView.param = $0 self.present(webView, animated: true) }, onError: { print($0) }) .disposed(by: disposeBag) } // MARK: - WebViewControllerDelegate func webViewDidRespondSomething(_ value: String) { connectC(resultOfB: value) .subscribe(onSuccess: { // ࠷ऴ݁ՌͰԿ͔͢Δ print($0) }, onError: { print($0) }) .disposed(by: disposeBag) }
None
None
8FC7JFX$POUSPMMFSʹ 0CTFSWFSΛஔ͚ ྻԽͰ͖ΔͷͰʁ
None
ͬͨ͜ͱ w ݺͼग़͢7$ʹ0CTFSWFSΛஔ͘ w ݺͼग़͠ॲཧΛQSPUPDPMʹ͢Δ
ݺͼग़͢7$ʹ 0CTFSWFSΛஔ͘ class WebViewController: UIViewController { var param: String! private
let resultSubject = PublishSubject<String>() // ҎԼུ } extension WebViewController { var result: Maybe<String> { return resultSubject.asMaybe() } }
ݺͼग़͢7$ʹ 0CTFSWFSΛஔ͘ // MARK: - WKNavigationDelegate extension WebViewController: WKNavigationDelegate {
override func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) { guard let result = doSomething(fromRequest: navigationAction.request) else { return } decisionHandler(.cancel) dismiss(animated: true) { [unowned self] in self.resultSubject.onNext(result) self.resultSubject.onCompleted() } }
ݺͼग़͠ॲཧΛ QSPUPDPMʹ͢Δ protocol WebViewOpenable { /// paramΛWebViewʹૹͬͯ݁ՌΛड͚औΔ func requestToWeb(withParam param:
String) -> Maybe<String> }
ݺͼग़͠ॲཧΛ QSPUPDPMʹ͢Δ extension WebViewOpenable where Self: UIViewController { func requestToWeb(withParam
param: String) -> Maybe<String> { guard let nav = R.storyboard.webView.instantiateInitialViewController(), let webView = nav.viewControllers.first as? WebView else { assertionFailure("Something wrong in WebView.storyboard") return Observable.error(CommonError.unknown) } webView.param = param defer { present(nav, animated: true) } return webView.result } }
ݩͷίʔυ func doSomething() { connectA() .subscribe(onSuccess: { [unowned self] in
let webView = // initialize WebViewController webView.delegate = self webView.param = $0 self.present(webView, animated: true) }, onError: { print($0) }) .disposed(by: disposeBag) } // MARK: - WebViewControllerDelegate func webViewDidRespondSomething(_ value: String) { connectC(resultOfB: value) .subscribe(onSuccess: { // ࠷ऴ݁ՌͰԿ͔͢Δ print($0) }, onError: { print($0) }) .disposed(by: disposeBag) }
ྻԽ͞Εͨίʔυ func doSomething() { connectA() .flatMap(requestToWeb) .flatMap(connectC) .subscribe(onSuccess: { //
࠷ऴ݁ՌͰԿ͔͢Δ print($0) }, onError: { print($0) }) .disposed(by: disposeBag) }
ྻԽ͞Εͨίʔυ func doSomething() { connectA() .flatMap { [unowned self] in
self.requestToWeb(withParam: $0) } .flatMap { [unowned self] in self.connectC(resultOfB: $0) } .bind(to: resultLabel.rx.text) .disposed(by: disposeBag) }
݁Ռ w ը໘ભҠ͕བྷΉΑ͏ͳॲཧϑϩʔભҠઌʹ 0CTFSWFSΛஔ͘͜ͱͰqBU.BQCJOEͰܨ͛Β ΕΔΑ͏ʹͳͬͨ w ॲཧதʹը໘ભҠ͕ൃੜ͢Δ͜ͱΛϑϩʔͷத Ͱҙࣝ͠ͳͯ͘ྑ͘ͳͬͨ w 1VCMJTI4VCKFDUJT༏ल
4BNQMF w IUUQTHJUIVCDPN,* 3Y4DSFFO5SBOTJUJPO4BNQMF
None