文章来源:淘论文网   发布者: 毕业设计   浏览量: 45



还可以点击去查询以下关键词:
[Swift]    [PeekPop]    [【Swift】PeekPop]   

项目介绍:

https://github.com/marmelroy/PeekPop

PeekPop

Peek和Pop是一个伟大的新的iOS功能,在iPhone 6S和6S +之后可以使用,允许您轻松地使用3D触摸预览内容。

可惜的是,开题报告,将近80%的iOS会员使用旧设备。

PeekPop是一个Swift框架,带来向后兼容的Peek和Pop。

Features 功能点1   Uses Apple's beautiful peek and pop interaction for devices with 3D touch.  
2   自定义对旧设备的压力敏感点击识别。  
3   在旧设备上可以流畅运行  
4   和Apple的API相同  
5   支持iOS8+  

缺失的功能:

支持在没有3D触摸的设备上进行预览和弹出预览操作。

Usage 使用方法

导入文件

import PeekPop

Create a PeekPop object, register your view controller for handling the peek and specify the source view. You will also need to declare that your view controller will conform to the PeekPopPreviewingDelegate protocol.

创建PeekPop对象,注册您的视图控制器以处理peek并指定源视图。 您还需要声明您的视图控制器将符合PeekPopPreviewingDelegate协议。

class MyViewController: UIViewController, PeekPopPreviewingDelegate { var peekPop: PeekPop? override func viewDidLoad() { peekPop = PeekPop(viewController: self) peekPop?.registerForPreviewingWithDelegate(self, sourceView: collectionView) }

PeekPopPreviewingDelegate requires implementing two simple functions. You will need to tell it what view controller to present for peeking purposes with:

PeekPopPreviewingDelegate需要实现两个简单的函数。

func previewingContext(previewingContext: PreviewingContext, viewControllerForLocation location: CGPoint) -> UIViewController?

...and you will need to tell it how to commit the preview view controller at the end of the transition with:
并且您将需要告诉它如何在转换结束时提交预览视图控制器:

func previewingContext(previewingContext: PreviewingContext, commitViewController viewControllerToCommit: UIViewController)How does it work?

In devices without 3D touch, PeekPop recognizes pressure on the screen by monitoring significant changes in UITouch's majorRadius value.

It assumes that by pressing harder on your iPhone, more of the surface area of your finger is in contact with the screen. This is true in the majority of cases.

Setting up with CocoaPodssource 'https://github.com/CocoaPods/Specs.git' pod 'PeekPop', '~> 0.1'Setting up with Carthage

Carthage is a decentralized dependency manager that automates the process of adding frameworks to your Cocoa application.

You can install Carthage with Homebrew using the following command:

$ brew update $ brew install carthage

To integrate PeekPop into your Xcode project using Carthage, specify it in your Cartfile:

github 'marmelroy/PeekPop'Inspiration

https://github.com/b3ll/Pseudo3DTouch

开题报告


这里还有:


还可以点击去查询:
[Swift]    [PeekPop]    [【Swift】PeekPop]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/8767.docx
  • 上一篇:BabyBluetooth
  • 下一篇:UIImageView显定制示GIF图问题