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
UIPreviewInteraction: Overview
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Tomohiro Nishimura
June 22, 2016
Technology
650
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
UIPreviewInteraction: Overview
Tomohiro Nishimura
June 22, 2016
More Decks by Tomohiro Nishimura
See All by Tomohiro Nishimura
レガシーシステム洗い出し大作戦
sixeight
0
1.7k
我々のRealmはどこからやってくるのか
sixeight
1
440
まだ見ぬAPIに思いを馳せて
sixeight
0
160
復習OptionSet
sixeight
0
310
今年読んだまんが
sixeight
0
260
べんりな検索ワード
sixeight
0
270
Readable Width in action
sixeight
0
200
Accessing the Music Library
sixeight
1
2.9k
Web APIについての雑談
sixeight
0
420
Other Decks in Technology
See All in Technology
4人目のSREはAgent
tanimuyk
0
200
気軽に使える"情報のハブ"としてのNotion活用 〜フロー情報の集積点 と、 Claude Code × Notion AI〜
syucream
1
200
10年間のブログ発信を振り返って見えたWebアプリケーションエンジニアとしての軌跡
stefafafan
0
190
起点・思考・出力で分解する 〜PM業務の自動化設計〜
kazu_kichi_67
2
1.1k
When Platform Engineering Meets GenAI
sucitw
0
180
Comment regagner la souveraineté de vos données tout en étant payé grâce à Nostr !
rlifchitz
0
210
AIのReact習熟度を測る
uhyo
2
690
製造現場での生成AIの活用、およびエージェントAIの実装のあり方、AVEVAの取り組み
iotcomjpadmin
0
110
AIに障害切り分けを全部やってもらった。 。 。 。
estie
0
170
いまさら聞けない「仕様駆動開発入門」 〜AI活用時代の開発プロセスを考える〜
findy_eventslides
2
210
AIが自律的に回る開発ループを設計してチーム開発に組み込む
nekorush14
0
130
AIチャットの改善から見えた、良いAI体験とは / What Constitutes a Good AI Experience: Insights from Improving AI Chat
kubode
0
120
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2k
The Language of Interfaces
destraynor
162
27k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
300
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
780
Tell your own story through comics
letsgokoyo
1
970
エンジニアに許された特別な時間の終わり
watany
107
250k
Code Reviewing Like a Champion
maltzj
528
40k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
210
Into the Great Unknown - MozCon
thekraken
41
2.6k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
Optimizing for Happiness
mojombo
378
71k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
210
Transcript
UIPreviewInteraction : Overview 2016/06/22 ؔϞόΠϧΞϓϦݚڀձ
id:Sixeight @tomohi_ro
None
Peek and Pop
2 ways • Storyboard Segue • UIViewControllerPreviewingDelegate
Storyboard Segue
Storyboard Segue override func prepare(for segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "previewSegue" { // for preview } }
UIViewControllerPreviewingDelegate class ItemListViewController: UITableViewController, UIViewControllerPreviewingDelegate { // ... }
UIViewControllerPreviewingDelegate override func viewDidLoad() { super.viewDidLoad() registerForPreviewing(with: self, sourceView: tableView)
}
UIViewControllerPreviewingDelegate Peek func previewingContext(_ previewingContext: UIViewControllerPreviewing, viewControllerForLocation location: CGPoint) ->
UIViewController? { guard let indexPath = tableView.indexPathForRow(at: location) else { return nil } let detailViewController = DetailViewController.instantiate() detailViewController.item = item(at: indexPath) let cellRect = tableView.rectForRow(at: indexPath) let sourceRect = previewingContext.sourceView.convert(cellRect, from: tableView) previewingContext.sourceRect = sourceRect return detailViewController }
UIViewControllerPreviewingDelegate Pop func previewingContext(_ previewingContext: UIViewControllerPreviewing, commit viewControllerToCommit: UIViewController) {
show(viewControllerToCommit, sender: self) }
None
None
How?
Custom Transitioning • UIViewControllerTransitioningDelegate • UIViewControllerAnimatedTransitioning • UIViewControllerInteractiveTransitioning • UIPresentationController
• UIGestureRecognizer
None
0.0 ʙ 1.0
UIPreviewInteraction
None
UIPreviewInteraction class DetailViewController : UIViewController { private var moreDetailPreviewInteraction: UIPreviewinteraction!
private var moreDetailVC = MoreDetailViewController() // ... }
UIPreviewInteraction override func viewDidLoad() { super.viewDidLoad() moreDetailPreviewInteraction = UIPreviewInteraction(view: view)
moreDetailPreviewInteraction.delegate = self }
UIPreviewInteractionDelegate extension DetailViewController : UIPreviewInteractionDelegate { }
UIPreviewInteractionDelegate • previewInteractionShouldBegin(_ previewInteraction: UIPreviewInteraction) -> Bool • previewInteraction(_ previewInteraction:
UIPreviewInteraction, didUpdatePreviewTransition transitionProgress: CGFloat, ended: Bool) • previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdateCommitTransition transitionProgress: CGFloat, ended: Bool)
UIPreviewInteractionDelegate • previewInteractionDidCancel(_ previewInteraction: UIPreviewInteraction)
UIPreviewInteractionDelegate func previewInteractionShouldBegin(_ previewInteraction: UIPreviewInteraction) -> Bool { return presentedViewController
!= nil }
UIPreviewInteractionDelegate func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdatePreviewTransition transitionProgress: CGFloat, ended: Bool)
{ // Initialize if presentedViewController != nil { present(moreDetailVC, animated: true) } // Update progress moreDetailVC.interactiveTransitionProgress = transitionProgress // Peek has finished if ended { moreDetailVC.completeCurrentInteractiveTransition() } }
UIPreviewInteractionDelegate func previewInteraction(_ previewInteraction: UIPreviewInteraction, didUpdateCommitTransition transitionProgress: CGFloat, ended: Bool)
{ // Update committing progress moreDetailVC.overInteractionProgress = transitionProgress // Pop has finished if ended { tailVC.overInteractionProgress = 0.0 } }
UIPreviewInteractionDelegate func previewInteractionDidCancel(_ previewInteraction: UIPreviewInteraction) { moreDetailVC.cancelCurrentInteractiveTransition() moreDetailVC.dismiss(animated: true) }
Conclusion (Japanese) • Preview ࣗମͷڍಈΛΧελϚΠζͰ͖ΔͷͰͳͯ͘ɺ3D Touch Ͱԡ͠ࠐΜͩͱ͖ͷ Preview ͷਐḿ۩߹Λऔಘग़དྷΔ •
࣮ࡍͷ Transition ͜Ε·Ͱͷํ๏Λͦͷ··͑Δ • Cancel ͕औΕΔͷخ͍͠ؾ͕͢Δ
References • https://developer.apple.com/videos/play/wwdc2016/228/ • https://developer.apple.com/reference/uikit/ uipreviewinteraction • https://developer.apple.com/reference/uikit/ uipreviewinteractiondelegate
കӍδϝδϝͯ͠ݏͰ͢Ͷ