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
Tomohiro Nishimura
June 22, 2016
Technology
660
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
450
まだ見ぬAPIに思いを馳せて
sixeight
0
160
復習OptionSet
sixeight
0
320
今年読んだまんが
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
全社に広がるMCPサーバーを、 どう安全に管理するか MCPass開発の舞台裏
mtpooh
3
280
Azure Cost Management の FOCUS コストデータを迷わず読むための“3つの軸”
tetsuyaooooo
0
140
全員がプロダクトへ向き合う組織を持続成長させるために——組織づくりのフライホイールと4象限 / The Flywheel Model and Four Quadrants for Organizational Design
hiro_torii
3
730
分割40%キーボードにスムーズに入門するには
hoto17296
1
230
多摩川(.dev)ランニング入門 / Tamagawa.dev#3
fujiwara3
3
320
Benchmarking Vector Databases: pgvector vs. LanceDB
tsho
0
130
DMMブックスのNext.js化を加速させるAI活用 / Migrating DMM Books to Next.js with AI
kentarom
1
330
【Oracle AI Spotlight ウェビナー】AWSか、Azureか、Google Cloudか。その議論にオラクルを含める意義。
oracle4engineer
PRO
2
220
Bet AI Day 2026丨バクラク Autopilot、業務システムの再設計
layerx
PRO
2
1.1k
[RSJ26] Hierarchy-Aware Multimodal Retrieval-Augmented Generation for Embodied Question Answering
keio_smilab
PRO
1
170
AIで実装は速くなった。なのにプロダクトは速くならない。職能の壁を越えて価値のフローを設計する
nwiizo
6
6.6k
Point Cloud as a Foreign Language for Multi-modal Large Language Model
takmin
0
370
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Code Reviewing Like a Champion
maltzj
528
40k
Deep Space Network (abreviated)
tonyrice
0
290
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
500
Marketing to machines
jonoalderson
1
5.7k
Designing for Timeless Needs
cassininazir
1
470
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
660
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.3k
The Cost Of JavaScript in 2023
addyosmani
55
10k
HDC tutorial
michielstock
2
840
The Limits of Empathy - UXLibs8
cassininazir
1
630
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
കӍδϝδϝͯ͠ݏͰ͢Ͷ