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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
Service Connect 上のサービスに ECS Service の外側から到達できなかった話
ota1022
1
270
トヨタ⽣産⽅式(TPS)⼊⾨
recruitengineers
PRO
3
960
案件に一番詳しいAIを Amazon Bedrock AgentCore で作る ― 知見が知見を生むチームへ / Compounding Knowledge with AgentCore
yusukeshimizu
1
130
20260807_第6回_関東kaggler会LT_claw系bot xangiと始める、"寂しくない" kaggle
sugupoko
0
320
20260804_Q4AzureUpdateBite_FabricDataAgentの精度を高める設計.pdf
matayuuu
1
140
なぜ Temporal の大小比較には compare しかないのか / Why Does Temporal Only Have compare() for Comparisons
kazukihayase
1
150
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
6
1.4k
モバイルアプリ開発概論2026
recruitengineers
PRO
6
650
猫付きpingコマンドを自作
uyuki234
0
250
同じWAFが、攻撃の“形”は弾く── 正当な“形”の不正は通す
kuroneko13
0
220
【AG-UI × A2UI × MCP Apps】Generative UIをやさしく解説する
nrinetcom
PRO
1
140
Sets in Go
ramalho
1
970
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
46
8.2k
A Soul's Torment
seathinner
6
3.4k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
370
Designing for humans not robots
tammielis
254
26k
エンジニアに許された特別な時間の終わり
watany
108
250k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Product Roadmaps are Hard
iamctodd
55
12k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
960
The SEO identity crisis: Don't let AI make you average
varn
0
530
Leo the Paperboy
mayatellez
8
2.1k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
240
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
73
41k
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
കӍδϝδϝͯ͠ݏͰ͢Ͷ