天天看点

Objective-C-UI控件学习之UIScreenEdgePanGestureRecognizer

简介

UIScreenEdgePanGestureRecognizer名字很长,而且关于其文档也是少的的可怜,苹果官方给的唯一的一个属性是edges,文档中的解释是这样的:

A UIScreenEdgePanGestureRecognizer looks for panning (dragging) gestures that start near an edge of the screen. The system uses screen edge gestures in some cases to initiate view controller transitions. You can use this class to replicate the same gesture behavior for your own actions.

       大概的意思就是UIScreenEdgePanGestureRecognizer跟pan(平移)手势差不多,需要从边缘进行拖动,在控制器转换的时候是有用的,看文档的话我们会发现 UIScreenEdgePanGestureRecognizer是 UIPanGestureRecognizer的子类,理解会更方便一点。

例子讲解

       例子:(可从InteractiveViewControllerTransitions中得到)

       例子原文是讲iOS7交互式过渡的: