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
26
The history of entry-point in iOS app Development
417_72ki
0
370
R.swift to Asset Symbols
417_72ki
0
260
Refactor with using `available` and `deprecated`
417_72ki
3
610
CLIツールにSwift Concurrencyを適用させようとしている話
417_72ki
3
400
CI with Danger-Swift
417_72ki
1
200
Graduation from Playground beginner
417_72ki
3
900
Trap Questions in Java and Obj-C
417_72ki
1
280
ダックタイピングとidでUserDefaultsをモック化する
417_72ki
2
2.5k
Other Decks in Technology
See All in Technology
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
130
継続的にアウトカムを生み出し ビジネスにつなげる、 戦略と運営に対するタイミーのQUEST(探求)
zigorou
0
560
NW-JAWS #14 re:Invent 2024(予選落ち含)で 発表された推しアップデートについて
nagisa53
0
270
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
38k
宇宙ベンチャーにおける最近の情シス取り組みについて
axelmizu
0
110
Qiita埋め込み用スライド
naoki_0531
0
5.1k
PHPからGoへのマイグレーション for DMMアフィリエイト
yabakokobayashi
1
170
PHPerのための計算量入門/Complexity101 for PHPer
hanhan1978
5
110
サービスでLLMを採用したばっかりに振り回され続けたこの一年のあれやこれや
segavvy
2
450
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
110
Wantedly での Datadog 活用事例
bgpat
1
470
ハイテク休憩
sat
PRO
2
150
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Adopting Sorbet at Scale
ufuk
73
9.1k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
2
290
Mobile First: as difficult as doing things right
swwweet
222
9k
The Invisible Side of Design
smashingmag
298
50k
Optimising Largest Contentful Paint
csswizardry
33
3k
Building Adaptive Systems
keathley
38
2.3k
We Have a Design System, Now What?
morganepeng
51
7.3k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
Code Review Best Practice
trishagee
65
17k
Imperfection Machines: The Place of Print at Facebook
scottboms
266
13k
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