iOS手势处理零星整理

20. 手势识别之UISwipeGestureRecognizer 手势识别UIGestureRecognizeriOS中, 手势识别主要使用UIGestureRecognizer, 我们一般使用它的子类, 现在我们学习使用UISwipeGestureRecognizer滑动手势1. UISwipeGestureRecognizer的使用import UIKitclass ViewController: UIViewController { var label 阅读详情

一、手势介绍

手势识别在 iOS 中非常重要,他极大地提高了移动设备的使用便捷性。iOS系统提供了一些常用的手势(UIGestureRecognizer 的子类),开发者可以直接使用他们进行手势操作。

  • UIPanGestureRecognizer(拖动)
  • UIPinchGestureRecognizer(捏合)
  • UIRotationGestureRecognizer(旋转)
  • UITapGestureRecognizer(点按)
  • UILongPressGestureRecognizer(长按)
  • UISwipeGestureRecognizer(轻扫)

另外,可以通过继承 UIGestureRecognizer 类,实现自定义手势(手势识别器类)。

PS:自定义手势时,需要 #import <UIKit/UIGestureRecognizerSubclass.h>,一般需实现如下方法:

- (void)reset;

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
//以上方法在分类 UIGestureRecognizer (UIGestureRecognizerProtected) 中声明,更多方法声明请自行查看

UIGestureRecognizer 的继承关系

二、手势状态

在六种手势识别中,只有一种手势(UITapGestureRecognizer)是离散型手势。

离散型手势的特点就是:一旦识别就无法取消,而且只会调用一次手势操作事件。

其他五种手势是连续型手势,而连续型手势的特点就是:会多次调用手势操作事件,而且在连续手势识别后可以取消手势。

从下图可以看出两者调用操作事件的次数是不同的:

手势状态枚举如下:

typedef NS_ENUM(NSInteger, UIGestureRecognizerState) {
  UIGestureRecognizerStatePossible,  // 尚未识别是何种手势操作(但可能已经触发了触摸事件),默认状态
  UIGestureRecognizerStateBegan,   // 手势已经开始,此时已经被识别,但是这个过程中可能发生变化,手势操作尚未完成
  UIGestureRecognizerStateChanged,  // 手势状态发生转变
  UIGestureRecognizerStateEnded,   // 手势识别操作完成(此时已经松开手指)
  UIGestureRecognizerStateCancelled, // 手势被取消,恢复到默认状态
  UIGestureRecognizerStateFailed,   // 手势识别失败,恢复到默认状态
  UIGestureRecognizerStateRecognized = UIGestureRecognizerStateEnded // 手势识别完成,同UIGestureRecognizerStateEnded
};

对于离散型手势 UITapGestureRecgnizer 要么被识别,要么失败,点按(假设点按次数设置为1,并且没有添加长按手势)下去一次不松开则此时什么也不会发生,松开手指立即识别并调用操作事件,并且状态为3(已完成)。

但是连续型手势要复杂一些,就拿旋转手势来说,如果两个手指点下去不做任何操作,此时并不能识别手势(因为我们还没旋转)但是其实已经触发了触摸开始事件,此时处于状态0;如果此时旋转会被识别,也就会调用对应的操作事件,同时状态变成1(手势开始),但是状态1只有一瞬间;紧接着状态变为2(因为我们的旋转需要持续一会),并且重复调用操作事件(如果在事件中打印状态会重复打印2);松开手指,此时状态变为3,并调用1次操作事件。

三、手势使用

手势使用分为三步:

  1. 创建手势识别器对象实例。创建时,指定一个回调方法,当手势开始,改变、或结束时,执行回调方法。
  2. 设置手势识别器对象实例的相关属性(可选部分)
  3. 添加到需要识别的 View 中。每个手势只对应一个 View,当屏幕触摸在 View 的边界内时,如果手势和预定的一样,那就会执行回调方法。

一个手势只能对应一个 View,但是一个 View 可以有多个手势。建议在真机上测试这些手势,模拟器操作不太方便,可能导致认为手势失效的情况。(模拟器测试捏合和旋转手势时,按住 option 键,再用触摸板或鼠标操作)

四、示例

功能描述:

附加到两个图片视图 UIImageView 的有『拖动』、『捏合』、『旋转』、『点按』;

而『轻扫』和『自定义手势 KMGestureRecognizer』附加在根视图 UIView 中。

拖动:进行当前图片视图位置移动

捏合:进行当前图片视图缩放

旋转:进行当前图片视图角度旋转

点按:双击恢复当前图片视图的缩放、角度旋转、不透明度

长按:设置当前图片视图的不透明度为0.7

轻扫:左右轻扫设置两个图片视图为居中,同时以垂直居中的特定偏移量定位

自定义手势:挠痒功能,左右扫动共3次或以上,设置两个图片视图为居中,同时以水平居中的特定偏移量定位

Kimi K2.5深度解析:中文语义理解与多跳推理实战指南 大语言模型的核心能力不仅在于参数规模,更在于对自然语言的深层理解与逻辑推演。中文大模型尤其面临语义模糊、语境依赖、文化隐喻等独特挑战。Kimi K2.5通过重构中文语义空间映射、强化语义一致性约束、引入高质量原创语料,在长文本理解、多跳推理和中文语义保真度三大维度实现突破。其技术价值体现在真实场景中的高精度信息提取、跨文档因果归因与自然语言意图还原,广泛适用于合同审查、竞品分析、会议纪要生成、学术文献解读等生产力场景。本文聚焦K2.5这一具体版本,揭示其如何以‘更懂中文’为支点,推动AI从演示走向可用。 阅读详情

相关推荐

UIGestureRecognizer学习之UISwipeGestureRecognizer(轻扫)

UISwipeGestureRecognizer是UIGestureRecognizer的子类。 UISwipeGestureRecognizer除了继承UIGestureRecognizer的属性外,还提供如下俩个属性:direction: //设置该手势处理器处理该方向的轻扫。该属性支持UISwipeGestureRecognizerDirectionRight(1<<0)、UISwipeG

甫式人生 1593

iOS 手势UIGestureRecognizer详解

一、引言 在iOS系统中,手势是进行用户交互的重要方式,通过UIGestureRecognizer类,我们可以轻松的创建出各种手势应用于app中。关于UIGestureRecognizer类,是对iOS中的事件传递机制面向应用的封装,将手势消息的传递抽象为了对象。 二、手势的抽象类——UIGestureRecognizer UIGestureRecognizer将一些和手势操作相关的方法抽象了出来,但它本身并不实现什么手势,因此,在开发中,我们一般不会直接使用UIGestureRecognizer的对象,而

Rey的技术博客 2661

iOS手势识别器(UIGestureRecognizer)编程详解

除了轻点手势识别器外,iOS还提供了其他常见的手势识别器,如拖动手势识别器(UIPanGestureRecognizer)、捏合手势识别器(UIPinchGestureRecognizer)、旋转手势识别器(UIRotationGestureRecognizer)等。在上述示例中,我们演示了如何添加手势识别器、实现手势事件处理方法,并介绍了常见的手势识别器和多手势识别的用法。在上述示例中,我们同时添加了拖动手势识别器和旋转手势识别器,并分别设置了它们的目标和动作。首先,我们需要在视图上添加手势识别器。

TechBurst的博客 372

iOS-UIGestureRecognizer详解-原理篇

前言 本文主要内容如下: 1. UIGestureRecognizer 属性、方法、代理和七个子类详解。 2. 讲讲 UIGestureRecognizer 和 UITouch 事件的关系。 3. 讲讲如何自定义手势? 一、手势识别器-UIGestureRecognizer 1.1 简介 UIGestureRecognizer是苹果在iOS 3.2之后,推出的手势识别功能。UIGes...

努力,可能成功!放弃,注定失败! 4472

01 AUTOSAR CP标准文档阅读指南

01 AUTOSAR CP标准文档阅读指南

汽车软件工程师 | 好奇博主 | 处女座 1134

解锁SPWM电压利用率:三次谐波注入幅值的黄金分割点

本文深入探讨了SPWM电压利用率的提升方法,重点介绍了三次谐波注入技术及其黄金分割点(1/6比例)。通过数学推导和工程实践,揭示了如何通过特定幅值的三次谐波注入将电压利用率从86.6%提升至115%,与SVPWM相当。文章还提供了实验室调试流程和DSP实现代码,帮助工程师优化逆变器设计。

weixin_30729609的博客 915

项目总结--Version 1.0(一)

  欢迎加入【iOS/Swift/OC开发交流群|127183325】交流学习。   公司项目的1.0版本已经结束有一段时间了,2.0版本也逐渐进入尾声,从1.0版本结束就计划着写一下项目总结,一是对项目进行一下思路梳理,二是总结一下之前的工作,找到所遇到的问题和架构的不合理之处,为接下来的版本做准备。由于2.0版本的任务比较紧急,一直没有时间做个系统的整理,只是零零星星的做了一...

dlgms057649的博客 229

别再折腾端口了!Kali Nethunter Kex 图形化桌面连接失败的真正原因与一键修复(附Termux命令)

本文深入分析了Kali Nethunter Kex图形化桌面连接失败的真正原因,包括端口配置变更、依赖缺失和权限问题,并提供了一键修复方案和Termux命令。通过详细的诊断步骤和优化配置,帮助用户快速恢复Kex功能,提升移动安全测试效率。

weixin_42530732的博客 417

iOS手势篇(八)-UISwipeGestureRecognizer详解

UISwipeGestureRecognizer作为iOS中的侧滑手势其实是用的比较多的一个手势.侧滑手势相较于Pan拖动手势来说.一些特殊的方法啊,属性啊,统统木有.打开头文件也只有简洁的两个属性 @property(nonatomic) NSUInteger numberOfTouchesRequired __TVOS_PROHIBITED; //...

MeteoriteMan的博客 4980

从手机到单片机:聊聊ARM Cortex家族那些事,A、R、M系列到底有啥不同?

本文深入解析ARM Cortex家族的A、R、M三大系列处理器,揭示它们在性能、实时响应和能效方面的核心差异。从智能手机到汽车电子和物联网设备,Cortex-A、R、M各司其职,分别应对复杂运算、实时控制和超低功耗场景。通过技术指标对比和典型应用案例,帮助开发者理解如何根据DMIPS/MHz等关键参数选择适合的处理器架构。

weixin_31574149的博客 350

汽车工程师必看:从CAN到Ethernet,6种车载通信协议全解析(附应用场景对比)

本文全面解析了从CAN到Ethernet的6种车载通信协议,包括CAN、LIN、MOST、FlexRay等,并对比了它们的应用场景和技术特点。文章详细介绍了各协议的演进历程、技术优势及在现代汽车中的混合网络架构设计,为汽车工程师提供了实用的协议选型指南和未来通信技术发展趋势。

weixin_28683689的博客 491

UIGestureRecognizer(基础)

UIGestureRecognizer(基础)

路漫漫其修远兮,吾将上下而求索! 1994

数仓 - 促销敏感度、评论敏感度

1. 促销敏感度 步骤1. 首先按照最后一次下单时间及有无复购情况将用户分为四大群体: 近一年有购物行为且复购的用户 -- L1 (今年复购用户) 近一年有购物行为但无复购的用户 --L2 (今年一单购用户) 最后一次下单时间在1年之前且有复购的用户 --L3 (今年无购且只有一单用户) 最后一次下单时间在1年之前但无复购的用户 -- L4 (今年无购多单用户) 步骤2. 每一类用户群再根据优惠订单占比、每单优惠金额占比的平均值、优惠金额这三个指标进行k-means聚类,分为: 非常敏感 -

weixin_41332009的博客 1898

UIPanGestureRecognizer进行视图滑动并处理手势冲突

首先我们肯定是给sourceVC的view上添加平移手势 UIPanGestureRecognizer 手势的实现方法中根据 Pan手势的三种状态 进行sourceVC的view的origin的处理 首先介绍一下 几个方法: 由于我们的sourceVC上存在tableview, 所以会导致tableview的滑动和pan滑动的 手势冲突 , 这也是为什么在上滑动过程中我屏蔽掉了tableview的scrollEnabled。但是当我们sourceVC滑动到上边界后,我们解开了tableview的滑动

Rey的技术博客 1505

冒泡排序的并行计算

本人也是并行计算的小白,在这里记录下自己的学习笔记。 今天做了一下冒泡排序的并行计算比较: 串行冒泡排序如下: #include <stdio.h> #include <stdlib.h> #include <windows.h> void BubbleSort(int * pData, int nSize) { if (!pData) { ...

gaoyi的专栏 4489

【WRFDA教程】客观分析(OBSGRID)详解

客观分析(OBSGRID)详解

WW、forever的博客 1133

iOS 手势操作:拖动、捏合、旋转、点按、长按、轻扫、自定义

1、UIGestureRecognizer 介绍 手势识别在 iOS 中非常重要,他极大地提高了移动设备的使用便捷性。 iOS 系统在 3.2 以后,他提供了一些常用的手势(UIGestureRecognizer 的子类),开发者可以直接使用他们进行手势操作。 UIPanGestureRecognizer(拖动) UIPinchGestureRecognizer(捏合) ...

weixin_33985679的博客 320

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

iOS手势篇(五)-UIPanGestureRecognizer详解

UIPanGestureRecognizer是iOS开发中不怎么常用的一个拖动(拖拽)手势. 打开UIPanGestureRecognizer.h头文件 /// 属性 @property (nonatomic) NSUInteger minimumNumberOfTouches __TVOS_PROHIBITED; // default is 1. the minimum n...

MeteoriteMan的博客 1万+

Camera2Demo

在Camera2 的基础上进行封装,使得Camera2一堆初始化逻辑与Activity分离,降低耦合度,完成预览拍照并保存的操作

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

iOS手势篇(十)-UITapGestureRecognizer详解

UITapGestureRecognizer是iOS开发(TVOS)开发中常用的一个轻触手势.和其他手势不一样的是.UITapGestureRecognizer手势是唯一的一个离散的手势.只有识别成功.识别结束.没有值改变等状态. 按照苹果推荐的做法.我们应该在手势结束的时候去做操作.不过基本上我们使用的时候就是直接执行.没有判断状态 /// 苹果推荐的方式 - (void)handleTap:(...

MeteoriteMan的博客 3740

RU DOS版、EFI版32bit/64bit BIOS常用工具

DOS版、EFI版的RU工具,可用来查看IO、MEM、PCI、SMBIOS等资源。亲测在EFI SHELL下可用。

UIGestureRecognizer 手势识别

一、概念介绍 UIGestureRecognizer是一个抽象类,定义了所有手势的基本行为,使用它的子类才能处理具体的手势 UITapGestureRecognizer(轻触,点按) UILongPressGestureRecognizer(长按) UISwipeGestureRecognizer(轻扫手势) UIRotationGestureRecognizer(旋转手势)

努力,可能成功!放弃,注定失败! 7300

iOS 七种手势操作(拖动、捏合、旋转、点按、长按、轻扫、自定义)详解及实例代码

手势识别在移动端( iOS) 中非常重要,极大地提高了移动设备的使用便捷性。iOS 系统在 3.2 以后,它提供了一些常用的手势(UIGestureRecognizer 的子类),开发者可以直接使用他们进行手势操作。UIPanGestureRecognizer(拖动)UIPinchGestureRecognizer(捏合)UIRotationGestureRecognizer(旋转)UITapGestureRecognizer(点按)

主要记录一些问题处理记录,部分是作为知识库使用 3518

UISwipeGestureRecognizer ---手指动作

UISwipeGestureRecognizer ---手指动作文章分类:移动开发tap是指轻触手势。类似鼠标操作的点击。从iOS 3.2版本开始支持完善的手势api:tap:轻触long press:在一点上长按pinch:两个指头捏或者放的操作pan:手指的拖动swipe:手指在屏幕上很快的滑动rotation:手指反向操作这为开发者编写手势识别操作,提供了很大的方便,想想之前用android写手势滑动的代码(编写android简单的手势切换视图示例),尤其感到幸福。这里写一个简单的tap操作。在下面视

ThomasQiuJS的专栏 2594

UIGestureRecognizer

UIGestureRecognizer 是一个具体手势的基类,提供了较为简单的手势实现方式   The concrete subclasses of UIGestureRecognizer are the following: UITapGestureRecognizer UIPinchGestureRecognizer UIRotationGestureR

691

一个好用的linux手册

一个好用的linux手册 https://www.linuxcool.com/

qq_41727408的博客 276

智能体软件架构设计:从LLM驱动到工程化落地的核心实践

在人工智能领域,大语言模型(LLM)的突破性进展正推动软件架构发生深刻变革。其核心原理在于,LLM作为强大的推理与内容生成引擎,赋予了软件系统理解自然语言意图和动态规划任务的能力。这一技术价值在于,它使得软件从被动执行预设指令的“工具”,转变为能够主动感知、规划并执行复杂任务的“智能体”,从而应对快速变化的业务需求。在应用场景上,智能体软件广泛适用于自动化数据分析、智能编程辅助、多智能体协作规划等领域。本文聚焦于智能体软件的核心架构,深入剖析了其由规划、工具调用、记忆和反思等模块构成的“感知-思考-行动”循

weixin_34218579的博客 441

iOS手势识别的详细使用(拖动,缩放,旋转,点击,手势依赖,自定义手势)

1、UIGestureRecognizer介绍 手势识别在iOS上非常重要,手势操作移动设备的重要特征,极大的增加了移动设备使用便捷性。 iOS系统在3.2以后,为方便开发这使用一些常用的手势,提供了UIGestureRecognizer类。手势识别UIGestureRecognizer类是个抽象类,下面的子类是具体的手势,开发这可以直接使用这些手势识别。 UITapGestureRecog...

空杯子 13万+
上一篇: UIView & CALayer 关系就像夫妻那样亲密无间
下一篇: 掌握了java锁的原理机制后其实变得很简单,难的是运用到各种业务的场景
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值