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
510
SharePlayの歴史と進化 そしてvisionOSへ (iOSDC 2023)
tokorom
2
860
5分でSharePlay入門
tokorom
2
1.4k
HomeKit 2020
tokorom
7
2.4k
Advanced Segue 2019年のSegue事情
tokorom
9
5.8k
tvOSアプリUIの勘所
tokorom
1
1.9k
カッコ悪くリアクティブじゃダメですか?
tokorom
7
12k
古き良きsendAction (in potatotips #26)
tokorom
1
3.5k
長生きするために心臓に悪いリリースはもうやめよう
tokorom
21
33k
Other Decks in Programming
See All in Programming
飲食業界向けマルチプロダクトを実現させる開発体制とリアルな現状
hiroya0601
1
370
Sidekiqで実現する 長時間非同期処理の中断と再開 / Pausing and Resuming Long-Running Asynchronous Jobs with Sidekiq
hypermkt
6
2.2k
Amazon Neptuneで始めてみるグラフDB-OpenSearchによるグラフの全文検索-
satoshi256kbyte
4
290
Generative AI Use Cases JP (略称:GenU)奮闘記
hideg
0
120
CSC305 Lecture 13
javiergs
PRO
0
120
Going Staff - Keynote edition
pragtob
0
430
Nuxtベースの「WXT」でChrome拡張を作成する | Vue Fes 2024 ランチセッション
moshi1121
1
290
カスタムしながら理解するGraphQL Connection
yanagii
0
680
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
180
Googleのテストサイズを活用したテスト環境の構築
toms74209200
0
240
offers_20241022_imakiire.pdf
imakurusu
2
310
推し活の ハイトラフィックに立ち向かう Railsとアーキテクチャ - Kaigi on Rails 2024
falcon8823
6
1.7k
Featured
See All Featured
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
355
29k
Into the Great Unknown - MozCon
thekraken
31
1.5k
Typedesign – Prime Four
hannesfritz
39
2.4k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
13
1.9k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
504
140k
Music & Morning Musume
bryan
46
6.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Building Your Own Lightsaber
phodgson
102
6k
Building an army of robots
kneath
302
42k
A designer walks into a library…
pauljervisheath
202
24k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
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