PeekPop 3D touch 兼容库 项目简介
Peek 和 Pop 是 iPhone 6S 和 6S+ 新推出的一项很棒的特性,可以让你轻松通过 3D touch 实现内容预览。但是还有大概 80% 的 iOS 用户使用的是老的设备。而 PeekPop 是一个 Swift 框架,可以让你的老系统支持 Peek 和 Pop 特性。示例代码:import PeekPop
class MyViewController: UIViewController, PeekPopPreviewingDelegate {
var peekPop: PeekPop?
override func viewDidLoad() {
peekPop = PeekPop(viewController: self)
peekPop?.registerForPreviewingWithDelegate(self, sourceView: collectionView)
}
func previewingContext(previewingContext: PreviewingContext, viewControllerForLocation location: CGPoint) -> UIViewController?
class MyViewController: UIViewController, PeekPopPreviewingDelegate {
var peekPop: PeekPop?
override func viewDidLoad() {
peekPop = PeekPop(viewController: self)
peekPop?.registerForPreviewingWithDelegate(self, sourceView: collectionView)
}
func previewingContext(previewingContext: PreviewingContext, viewControllerForLocation location: CGPoint) -> UIViewController?