0407--iOS之Touches, Presses, and Gestures目录大纲

Touches, Presses, and Gestures

Encapsulate your app's event-handling logic in gesture recognizers so that you can reuse that code throughout your app.

--将app的事件处理逻辑封装在手势识别器中,以便可以在整个app中重用该代码。

 

Overview

If you build your apps using standard UIKit views and controls, UIKit automatically handles touch events (including Multitouch events) for you. However, if you use custom views to display your content, you must handle all touch events that occur in your views. There are two ways to handle touch events yourself.
    --如果您使用标准的UIKit视图和控件构建应用程序,UIKit会自动为您处理触摸事件(包括多点触摸事件)。但是,如果使用自定义视图显示内容,则必须处理视图中发生的所有触摸事件。有两种方法可以自己处理触摸事件。

  • Use gesture recognizers to track the touches; see Handling UIKit Gestures.
    --使用手势识别器来跟踪触摸事件,参考超链接:处理UIKit的手势

  • Track the touches directly in your UIView subclass; see Handling Touches in Your View.
    --直接在UIView子类中跟踪触摸;请参见超链接:在视图中处理触摸

Topics                                 --专题

First Steps                      --第一步

 

Using Responders and the Responder Chain to Handle Events                 --使用在响应者链中的响应者来响应事件

Learn how to handle events that propagate through your app.

 

class UIResponder                                --响应者类

An abstract interface for responding to and handling events.

 

class UIEvent                           --时间类

An object that describes a single user interaction with your app.

 

Touches                              --触摸

 

Handling Touches in Your View

Use touch events directly on a view subclass if touch handling is intricately linked to the view's content.

 

Handling Input from Apple Pencil

Learn how to detect and respond to touches from Apple Pencil.

 

Tracking the Force of 3D Touch Events

Manipulate your content based on the force of touches.

 

Illustrating the Force, Altitude, and Azimuth Properties of Touch Input

Capture Apple Pencil and touch input in views.

 

Leveraging Touch Input for Drawing Apps

Capture touches as a series of strokes and render them efficiently on a drawing canvas.

class UITouch

An object representing the location, size, movement, and force of a touch occurring on the screen.

 

Button Presses                       --按钮按压

class UIPress

An object that represents the presence or movement of a button press on the screen for a particular event.

class UIPressesEvent

An event that describes the state of a set of physical buttons that are available to the device, such as those on an associated remote or game controller.

 

Standard Gestures                     --标准手势

 

Handling UIKit Gestures

Use gesture recognizers to simplify touch handling and create a consistent user experience.

 

Coordinating Multiple Gesture Recognizers

Discover how to use multiple gesture recognizers on the same view.

class UIHoverGestureRecognizer

A gesture recognizer that looks for pointer movement over a view.

class UILongPressGestureRecognizer

A concrete subclass of UIGestureRecognizer that looks for long-press gestures.

class UIPanGestureRecognizer

A concrete subclass of UIGestureRecognizer that looks for panning (dragging) gestures.

class UIPinchGestureRecognizer

A concrete subclass of UIGestureRecognizer that looks for pinching gestures involving two touches.

class UIRotationGestureRecognizer

A concrete subclass of UIGestureRecognizer that looks for rotation gestures involving two touches.

class UIScreenEdgePanGestureRecognizer

A gesture recognizer that looks for panning (dragging) gestures that start near an edge of the screen.

class UISwipeGestureRecognizer

A concrete subclass of UIGestureRecognizer that looks for swiping gestures in one or more directions.

class UITapGestureRecognizer

A concrete subclass of UIGestureRecognizer that looks for single or multiple taps.

 

Custom Gestures                     --用户自定义手势

 

Implementing a Custom Gesture Recognizer

Discover when and how to build your own gesture recognizers

class UIGestureRecognizer

The base class for concrete gesture recognizers.

protocol UIGestureRecognizerDelegate

A set of methods implemented by the delegate of a gesture recognizer to fine-tune an app’s gesture-recognition behavior.

 

3D Touch Interactions                     --3D触摸交互

class UIPreviewInteraction

A class that registers a view to provide a custom user experience in response to 3D Touch interactions.

protocol UIPreviewInteractionDelegate

A set of methods for communicating the progress of a preview interaction.

protocol UIPreviewActionItem

A set of methods that defines the styles you can apply to peek quick actions and peek quick action groups, and defines a read-only accessor for the user-visible title of a peek quick action.

 

See Also

User Interactions

 

Drag and Drop

Bring drag and drop to your app by using interaction APIs with your views.

 

Pointer Interactions

Support pointer interactions in your custom controls and views.

 

Pencil Interactions

Handle double-tap user interactions on Apple Pencil.

 

Focus-based Navigation

Navigate the interface of your UIKit app using a remote or a game controller.

 

Menus and Shortcuts

Simplify interactions with your app using menu systems, contextual menus, Home screen quick actions, and keyboard shortcuts.

 

Accessibility

Make your apps accessible to everyone, including people with disabilities.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值