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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
280
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
Network Firewallやっていき!
news_it_enj
0
200
データエンジニアリングとドメイン駆動設計
masuda220
PRO
9
1.5k
公式ドキュメントの歩き方etc
coco_se
1
120
41歳でAWSが好きすぎてITエンジニアになったおっさんの話
yama3133
0
600
LLMやAIエージェントをソフトウェアに組み込むプラクティス
shibuiwilliam
2
440
SoccerMaster: A Vision Foundation Model for Soccer Understanding
kzykmyzw
0
150
大量データに対しても、生成AIを用いてリーズナブルにデータ加工をしたい!Databricksのai_queryについて調べてみた
kamoshika
1
230
複数プロダクトで進めるAI機能実装 ── 実践から得たリアルな学びとロードマップ実現への挑戦 / AICon2026_yanari
rakus_dev
0
230
伝票作成AIエージェントを支える、LLMOpsとインフラの選択肢 / AICon2026_takeda
rakus_dev
0
220
kaonavi Tech Night#1
kaonavi
0
130
「休む」重要さ
smt7174
2
440
アップデートで何が変わった?デモで学んで使いこなすIBM Bob2.0
muehara
0
200
Featured
See All Featured
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
150
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
390
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
220
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
770
Designing Experiences People Love
moore
143
24k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
660
We Have a Design System, Now What?
morganepeng
55
8.2k
How to train your dragon (web standard)
notwaldorf
97
6.7k
Discover your Explorer Soul
emna__ayadi
2
1.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
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
കӍδϝδϝͯ͠ݏͰ͢Ͷ