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
610
SharePlayの歴史と進化 そしてvisionOSへ (iOSDC 2023)
tokorom
3
900
5分でSharePlay入門
tokorom
3
1.4k
HomeKit 2020
tokorom
7
2.5k
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
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
モバイルアプリにおける自動テストの導入戦略
ostk0069
0
110
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
300
暇に任せてProxmoxコンソール 作ってみました
karugamo
1
710
rails statsで大解剖 🔍 “B/43流” のRailsの育て方を歴史とともに振り返ります
shoheimitani
2
930
StarlingMonkeyを触ってみた話 - 2024冬
syumai
3
270
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
160
バグを見つけた?それAppleに直してもらおう!
uetyo
0
170
フロントエンドのディレクトリ構成どうしてる? Feature-Sliced Design 導入体験談
osakatechlab
8
4.1k
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.6k
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
350
Featured
See All Featured
The Language of Interfaces
destraynor
154
24k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Scaling GitHub
holman
458
140k
Agile that works and the tools we love
rasmusluckow
328
21k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
Automating Front-end Workflow
addyosmani
1366
200k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Git: the NoSQL Database
bkeepers
PRO
427
64k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
YesSQL, Process and Tooling at Scale
rocio
169
14k
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