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.7k
画面遷移と私(iOS)
画面遷移のときに値渡したりもらったりするところ、もっと簡単に書きたいよね!のアップデート。
tokorom
July 14, 2015
Tweet
Share
More Decks by tokorom
See All by tokorom
続・SharePlayの歴史と進化 iOS18とApple Vision Proにおける新展開
tokorom
3
560
SharePlayの歴史と進化 そしてvisionOSへ (iOSDC 2023)
tokorom
2
880
5分でSharePlay入門
tokorom
2
1.4k
HomeKit 2020
tokorom
7
2.4k
Advanced Segue 2019年のSegue事情
tokorom
9
5.8k
tvOSアプリUIの勘所
tokorom
1
2k
カッコ悪くリアクティブじゃダメですか?
tokorom
7
12k
古き良きsendAction (in potatotips #26)
tokorom
1
3.6k
長生きするために心臓に悪いリリースはもうやめよう
tokorom
21
33k
Other Decks in Programming
See All in Programming
ローコードSaaSのUXを向上させるためのTypeScript
taro28
1
630
CSC509 Lecture 13
javiergs
PRO
0
110
CSC509 Lecture 09
javiergs
PRO
0
140
Functional Event Sourcing using Sekiban
tomohisa
0
100
Amazon Bedrock Agentsを用いてアプリ開発してみた!
har1101
0
340
Figma Dev Modeで変わる!Flutterの開発体験
watanave
0
150
レガシーシステムにどう立ち向かうか 複雑さと理想と現実/vs-legacy
suzukihoge
14
2.3k
Better Code Design in PHP
afilina
PRO
0
130
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
300
Jakarta EE meets AI
ivargrimstad
0
620
A Journey of Contribution and Collaboration in Open Source
ivargrimstad
0
1k
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
The World Runs on Bad Software
bkeepers
PRO
65
11k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
110
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Producing Creativity
orderedlist
PRO
341
39k
Why Our Code Smells
bkeepers
PRO
334
57k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
StorybookのUI Testing Handbookを読んだ
zakiyama
27
5.3k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
430
Fireside Chat
paigeccino
34
3k
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