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
31
The history of entry-point in iOS app Development
417_72ki
0
380
R.swift to Asset Symbols
417_72ki
0
270
Refactor with using `available` and `deprecated`
417_72ki
3
620
CLIツールにSwift Concurrencyを適用させようとしている話
417_72ki
3
410
CI with Danger-Swift
417_72ki
1
200
Graduation from Playground beginner
417_72ki
3
910
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
いま現場PMのあなたが、 経営と向き合うPMになるために 必要なこと、腹をくくること
hiro93n
9
7.7k
デジタルアイデンティティ技術 認可・ID連携・認証 応用 / 20250114-OIDF-J-EduWG-TechSWG
oidfj
2
680
20250116_JAWS_Osaka
takuyay0ne
2
200
完全自律型AIエージェントとAgentic Workflow〜ワークフロー構築という現実解
pharma_x_tech
0
350
FODにおけるホーム画面編成のレコメンド
watarukudo
PRO
2
280
RubyでKubernetesプログラミング
sat
PRO
4
160
[IBM TechXchange Dojo]Watson Discoveryとwatsonx.aiでRAGを実現!座学①
siyuanzh09
0
110
iPadOS18でフローティングタブバーを解除してみた
sansantech
PRO
1
140
2025年の挑戦 コーポレートエンジニアの技術広報/techpr5
nishiuma
0
140
2025年に挑戦したいこと
molmolken
0
160
深層学習と3Dキャプチャ・3Dモデル生成(土木学会応用力学委員会 応用数理・AIセミナー)
pfn
PRO
0
460
AIアプリケーション開発でAzure AI Searchを使いこなすためには
isidaitc
1
120
Featured
See All Featured
Unsuck your backbone
ammeep
669
57k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
Code Review Best Practice
trishagee
65
17k
How to train your dragon (web standard)
notwaldorf
89
5.8k
Building Your Own Lightsaber
phodgson
104
6.2k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
173
51k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7.1k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Being A Developer After 40
akosma
89
590k
Gamification - CAS2011
davidbonilla
80
5.1k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
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