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
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
280
Ethereum_.pdf
nekomatu
0
460
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
What’s New in Compose Multiplatform - A Live Tour (droidcon London 2024)
zsmb
1
470
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
AI時代におけるSRE、 あるいはエンジニアの生存戦略
pyama86
6
1.1k
イベント駆動で成長して委員会
happymana
1
320
Hotwire or React? ~アフタートーク・本編に含めなかった話~ / Hotwire or React? after talk
harunatsujita
1
120
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
100
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
Macとオーディオ再生 2024/11/02
yusukeito
0
370
.NET のための通信フレームワーク MagicOnion 入門 / Introduction to MagicOnion
mayuki
1
1.4k
Featured
See All Featured
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Embracing the Ebb and Flow
colly
84
4.5k
GraphQLとの向き合い方2022年版
quramy
43
13k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
410
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
What's in a price? How to price your products and services
michaelherold
243
12k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Unsuck your backbone
ammeep
668
57k
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