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
画面遷移と私(iOS)
Search
tokorom
July 14, 2015
Programming
4
3.6k
画面遷移と私(iOS)
画面遷移のときに値渡したりもらったりするところ、もっと簡単に書きたいよね!のアップデート。
tokorom
July 14, 2015
Tweet
Share
More Decks by tokorom
See All by tokorom
SharePlayの歴史と進化 そしてvisionOSへ (iOSDC 2023)
tokorom
2
750
5分でSharePlay入門
tokorom
2
1.4k
HomeKit 2020
tokorom
7
2.3k
Advanced Segue 2019年のSegue事情
tokorom
9
5.6k
tvOSアプリUIの勘所
tokorom
1
1.8k
カッコ悪くリアクティブじゃダメですか?
tokorom
7
12k
古き良きsendAction (in potatotips #26)
tokorom
1
3.5k
長生きするために心臓に悪いリリースはもうやめよう
tokorom
21
33k
potatotips#8 Swiftのライブラリを作成/利用しよう
tokorom
7
3.6k
Other Decks in Programming
See All in Programming
How to send distibuted traces to Datadog using build own OpenTelemetry-Lambda distribution
aereal
3
110
ソートできるUUID v7をJavaで使うときの話
yoshiori
7
5.1k
ボトムアップではじめるFour Keys・SPACEを用いた開発プロセスの改善事例 〜開発生産性に向き合ってチームの成長を実感する〜
nomuson
1
250
IaCにおけるテスト考察 / Tests in IaC
linyows
2
240
タクシーアプリ『GO』を運営する中発生した様々な失敗例の紹介
mot_techtalk
8
5.4k
技術カンファレンスをより楽しむためにやるべき N 個のこと / N Things You Should Do to Enjoy Tech Conferences More
mackey0225
3
270
K2のKotlin IDEプラグインの中を覗いてみよう♪
yanex
0
1.9k
Enhancing Ansible Development with SOLID Principles
kksat
0
130
Cloudless Computingの論文紹介
yuukit
1
240
GoogleI/O2024 LT報告会資料
shinsukefujita1126
0
190
俺たちのPHPの型システムはすごいぞっ!
suguruooki
1
210
ドラ🔵もんでDIを学ぶ
tomo1227
0
4.7k
Featured
See All Featured
Music & Morning Musume
bryan
42
5.8k
Designing the Hi-DPI Web
ddemaree
276
33k
Docker and Python
trallard
36
2.8k
The Invisible Side of Design
smashingmag
294
50k
Reflections from 52 weeks, 52 projects
jeffersonlam
345
19k
Building Better People: How to give real-time feedback that sticks.
wjessup
356
18k
Git: the NoSQL Database
bkeepers
PRO
423
64k
Adopting Sorbet at Scale
ufuk
69
8.7k
Practical Orchestrator
shlominoach
184
9.9k
Build The Right Thing And Hit Your Dates
maggiecrowley
27
2.1k
Build your cross-platform service in a week with App Engine
jlugia
227
17k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
275
13k
Transcript
ը໘ભҠͱࢲʢiOSʣ ॴ ༑ଠ @tokorom iOS App Programer potatotips-19
ॴ༑ଠ @tokorom
ͪΐ͏Ͳ1લ ୈ6ճ potatotips
iOSͷը໘ભҠͱࢲ ॴ ༑ଠ @tokorom iOS App Programer potatotips-19
ը໘ભҠͷྺ࢙
ը໘ભҠͷྺ࢙ •لݩલɿStoryboardొલ •لݩޙɿStoryboardొҎޙ •৽࣌ɿcontext࣌ʁ
StoryboardొҎલͷը໘ભҠ let selectVC = SelectItemVC() selectVC.targetUser = self.user self.presentViewController(selectVC, animated:
true, completion: nil) ભҠઌʹΛ͢
StoryboardొҎલͷը໘ભҠ selectVC.delegate = self extension MyViewController: SelectItemVCDelegate { override func
itemDidSelect(item: Item) { // get an item! } } ભҠઌ͔ΒΛΒ͏
Storyboard࣌ͷը໘ભҠ self.performSegueWithIdentifier("SelectItems", sender: nil) override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?)
{ switch segue.identifier { case: "SelectItems": if let selectVC = segue.destinationViewController as? SelectItemsViewController { selectVC.user = self.user } ભҠઌʹΛ͢
Storyboard࣌ͷը໘ભҠ @IBAction func unwind(segue: UIStoryboardSegue) { if let vc =
segue.sourceViewController as? SelectitemVC { let item = vc.selectedItem } } ભҠઌ͔ΒΛΒ͏
WatchKitͰͷྫ self.presentControllerWithName("SelectItem", context: user) override func awakeWithContext(context: AnyObject?) { super.awakeWithContext(context)
self.user = context as? User } ભҠઌʹΛ͢
WatchKitͰͷྫ self.presentControllerWithName("SelectItem", context: user) override func awakeWithContext(context: AnyObject?) { super.awakeWithContext(context)
self.user = context as? User } ભҠઌʹΛ͢
WatchKitͷcontextͷྑ͍ͱ͜Ζ •ૄ݁߹ʂ •Λ͢ͱ͖ʹભҠݩͱભҠઌ͕ґଘ͕ؔͰ ͖ͳ͍ •ಉ͡ΠϯλʔϑΣʔεͰͳΜͰͤΔ •Optional BidingͳͲͰ؆୯/҆શʹड͚औΕΔ
ͳ͓… ̍ϲ݄લͷ΅͘
Swift࣌ΈΜͳ͜͏ॻ͖͍ͨΑͶ self.performSegueWithIdentifier("ItemSelect", context: user) { (item: Item) in let selectedItem
= item } ભҠઌʹΛ͢ˍΒ͏
ͪΐ͏Ͳ1લ ୈ6ճ potatotips
ͪΐ͏Ͳ1લ ୈ6ճ potatotips
ͦͯ͠ࠓʂ https://github.com/tokorom/SegueContext
͜ͷॻ͖ํɺͰ͖·͢ʂ self.performSegueWithIdentifier("ItemSelect", context: user) { (item: Item) in let selectedItem
= item } ભҠઌʹΛ͢ˍΒ͏
UIViewController+Contextͷྑ͍ͱ͜ •ૄ݁߹ʂ •SwiftͰܕ҆શͳͷड͚͠ •NavigationControllerͱ͔TabBarControllerΛڬΜ ͰͬͪΌΒ •ΧελϜSegueͳͲෳࡶͳભҠͰ͑Δ •Apple Way͔ΒͣΕ͗͢ͳ͍ʁ
More Information Yuta ToKoRo iOS App Programer Twitter @tokorom http://www.tokoro.me/
https://github.com/tokorom/SegueContext