- 浏览: 643904 次
- 性别:
- 来自: 北京
文章分类
最新评论
-
lizaochengwen:
网络请求碰到的中文乱码使用encodeURL吧- (NSStr ...
iPhone开发/iPad开发 中文乱码问题 -
hhb19900618:
还是没弄懂怎么解决了中文乱码? 正确代码能重写贴出吗
iPhone开发/iPad开发 中文乱码问题 -
zhengjj_2009:
我的理解是讲ipa文件解压缩之后再重新打包,已经破坏了签名,所 ...
xcodebuild和xcrun实现自动打包iOS应用程序 -
zhengjj_2009:
我参考你的“ 从ipa格式的母包生成其它渠道包的shell脚本 ...
xcodebuild和xcrun实现自动打包iOS应用程序 -
同一片天空:
问题果然解决了
iOS 搭建 XMPP实现环境
继承自: UIResponder : NSObject
遵 循: NSObject (NSObject)
框 架: /System/Library/Frameworks/UIKit.framework
可用平台: iPhone OS 2.0 或者更新
接口类: UIEvent.h
关联例子: aurioTouch
GLPaint
MoveMe
Touches
目录 [隐藏]
1 Overview
2 Tasks
2.1 Getting the Touches for an Event
2.2 Getting Event Attributes
3 Properties
3.1 timestamp
4 Instance Methods
4.1 allTouches
4.2 touchesForView:
4.3 touchesForWindow:
[编辑]
Overview
概述
A UIEvent object (or, simply, an event object) represents an event in iPhone OS. An event object contains one or more touches (that is, finger gestures on the screen) that have some relation to the event. A touch is represented by a UITouch object.
一个UIEvent对象(或者,简单的事件对象)在iPhone OS中变现为事件。一个事件对象包含一个或者多个触摸(那是,手指在屏幕上的交互)关联事件。一个触摸事件表现为一个UITouch对象。
When an event occurs, the system routes it to the appropriate responder and passes in the UIEvent object in a message invoking a UIResponder method such as touchesBegan:withEvent:. The responder can then evaluate the touches for the event or for a particular phase of the event and handle them appropriately. The methods of UIEvent allow you to obtain all touches for the event (allTouches) or only those for a given view or window (touchesForView: or touchesForWindow:). It can also distinguish an event object from objects representing other events by querying an object for the time of its creation (timestamp).
当一个事件触发了,系统将会把它传递给合适的响应对象并通过UIEvent对象发出一个消息调用UIResponder方法如 touchesBegan:withEvent: 。响应对象可以分配触摸事件到合适的触摸类型并适当的控制他们。UIEvent中的方法可以让你获取全部的触摸事件或者给定的视图或者窗口(touchesForView: 或者 touchesForWindow:)。它可以分辨从响应对象传递过来的事件对象发生的时间(timestamp)。
A UIEvent object is persistent throughout a multi-touch sequence; UIKit reuses the same UIEvent instance for every event delivered to the application. You should never retain an event object or any object returned from an event object. If you need to keep information from an event around from one phase to another, you should copy that information from the UITouch or UIEvent object.
一个UIEvent对象贯穿在多点触摸事件的序列中;UIKit 重用同一个UIEvent实例来分配每一个事件到应用程序。你不需要保持一个事件对象或者任何从事件对象返回的对象。如果你需要保存事件对象然後传递到另外一个对象,你需要从UITouch或者UIEvent中复制信息。
See "Event Handling" in iPhone Application Programming Guide for further information on event handling.
有关更多事件控制的信息你可以查看 iPhone Application Programming Guide 中的事件控制一章。
[编辑]
Tasks
任务
[编辑]
Getting the Touches for an Event
获取事件中的触摸对象
– allTouches
– touchesForView:
– touchesForWindow:
[编辑]
Getting Event Attributes
获取事件属性
timestamp property
[编辑]
Properties
属性
For more about Objective-C properties, see “Properties” in The Objective-C 2.0 Programming Language.
更多有关Objective-C属性的信息,请看The Objective-C 2.0 Programming Language中的"Properties"这一章
[编辑]
timestamp
The time when the event occurred. (read-only)
事件发生的时间。(只读)
@property(nonatomic, readonly) NSTimeInterval timestamp
Discussion
讨论
The property value is the number of seconds since system startup.
这个属性的值是一个数字当系统启动的时候。
Availability
可用平台
Available in iPhone OS 2.0 and later.
可用于iPhone OS 2.0或者更新
Declared In
定义文件
UIEvent.h
[编辑]
Instance Methods
实例方法
[编辑]
allTouches
Returns all touch objects associated with the receiver.
返回和接收者有关的所有触摸对象
- (NSSet *)allTouches
Return Value
返回值
A set of UITouch objects representing all touches associated with an event (represented by the receiver).
一个UITouch对象的集合包含所有的触摸事件(取决于那个接收者)
Discussion
讨论
If the touches of the event originate in different views and windows, the UITouch objects obtained from this method will have different responder objects associated with the touches.
如果事件的触摸对象来自不同的视图或者窗口,那UITouch对象将会从不同的响应对象中获取触摸事件。
Availability
可用平台
Available in iPhone OS 2.0 and later.
可用于iPhone OS 2.0或者更新
See Also
同类参考
– touchesForView:
– touchesForWindow:
Related Sample Code
关联的例子代码
aurioTouch
Metronome
Declared In
定义文件
UIEvent.h
[编辑]
touchesForView:
Returns the touch objects that belong to a given view for the event represented by the receiver.
返回属于接收者给定的视图的事件响应的触摸对象
- (NSSet *)touchesForView:(UIView *)view
Parameters
参数
view
The UIView object on which the touches related to the event were made.
一个关联触摸事件发生的UIView对象
Return Value
返回值
An set of UITouch objects representing the touches for the specified view related to the event represented by the receiver.
接收者关联视图的事件响应者发出的UITouch对象集合
Availability
可用平台
Available in iPhone OS 2.0 and later.
可用于iPhone OS 2.0或者更新
See Also
同类参考
– allTouches
– touchesForWindow:
Related Sample Code
关联的例子代码
GLPaint
Declared In
定义文件
UIEvent.h
[编辑]
touchesForWindow:
Returns the touch objects that belong to a given window for the event represented by the receiver.
返回接收者给定的窗口的触摸事件的事件响应对象
- (NSSet *)touchesForWindow:(UIWindow *)window
Parameters
参数
window
The UIWindow object on which the touches related to the event were made.
一个发生触摸事件关联的UIWindow对象
Return Value
返回值
An set of UITouch objects representing the touches for the specified window related to the event represented by the receiver.
接收者关联窗口的事件响应者发出的UITouch对象集合
Availability
可用平台
Available in iPhone OS 2.0 and later.
可用于iPhone OS 2.0或者更新
See Also
同类参考
– allTouches
– touchesForView:
Declared In
定义文件
UIEvent.h
发表评论
-
SOCK_STREAM和SOCK_DGRAM
2015-07-23 20:08 1567sock_stream 是有保障的(即能保证数据正确传送到 ... -
SOCKET bind INADDR_LOOPBACK和INADDR_ANY的区别
2015-07-23 19:49 2004今天写程序时候,服务器端启动了,然后客户端总是连接不上,con ... -
htons()
2015-07-23 19:26 532在C/C++写网络程序的时候,往往会遇到字节的网络顺序和主机顺 ... -
使用symbolicatecrash分析crash文件
2015-03-10 11:32 1119原文 http://www.cnblogs.com/ning ... -
程序设计中的计算复用(Computational Reuse)
2015-02-10 10:18 608从斐波那契数列说起 ... -
didReceiveMemoryWarning
2015-02-09 16:11 488IPhone下每个app可用的内存是被限制的,如果一个app使 ... -
iOS开发中怎么响应内存警告
2015-02-09 16:08 606好的应用应该在系统内存警告情况下释放一些可以重新创建的资源。在 ... -
ASIHTTPRequest多次重复请求的问题
2014-12-17 14:34 591在一个车票订购的项目中,点击一次订购,却生成了2次订单,通过抓 ... -
从 CloudKit 看 BaaS 服务的趋势
2014-09-26 11:51 691从 6 月份 WWDC 苹果发布 ... -
ios编程--AVCapture编程理解
2014-09-26 11:03 8720、媒体采集的几个东西。这里所需要明白的是,在这个流程中,这里 ... -
NSURLProtocol
2014-09-25 10:42 7601、http://nshipster.com/nsurlpro ... -
关于iOS8的extension插件
2014-09-25 10:41 1217关于iOS8的extension插件,有兴趣的同学可以参考一下 ... -
【转】ios app在itunesConnect里面的几种状态
2014-08-05 10:34 1090Waiting for Upload (Yellow) Ap ... -
[转]iOS Dev (45) iOS图标与切片处理工具Prepo
2014-02-07 17:02 988iOS Dev (45) iOS图标与切片处理工具Prepo ... -
phoneGap开发IOS,JS调用IOS方法/phoneGap插件开发
2014-01-13 17:49 1207前沿 废话不说phoneGap是什么不多介绍,官方网站: h ... -
如何在IOS平台下搭建PhoneGap开发环境(PhoneGap2.5)
2014-01-13 15:23 700由于在下最近在做基于HTML5的跨平台移植,搭建环境的时候着实 ... -
xcode 4 制作静态库详解
2013-12-20 18:27 484最近在做Apple的IOS开发,有开发静态库的需求,本身IOS ... -
【翻译】ios教程-创建静态库
2013-12-20 18:19 3011作者:shede333 主页:htt ... -
封装自己的控件库:iPhone静态库的应用
2013-12-20 17:03 511由于iPhone 控件的极度匮乏和自定义组件在重用上的限制,在 ... -
iphone:使用NSFileManager取得目录下所有文件(遍历所有文件)
2013-11-18 17:56 825From:http://note.sdo.com/u/xiao ...
相关推荐
UIEvent_Class,苹果手机触屏事件的存储类,解决触摸问题
ios事件响应链,重写- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event以及- (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event方法来查看系统响应事件的逻辑
UIEvent是一系列UITouch的集合,在IOS中负责响应触摸事件。另外还提到了响应者链的概念,在IOS中,所有事件有一个最先响应者,事件可以沿着响应者链向下传递。 接下来是UIControl对象 UIControl是UIView的子类,当然...
(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ self.touchTimer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(addView) userInfo:nil repeats:NO];...
YSTabBarOutSide文件夹:控件... override func point(inside point: CGPoint, with event: UIEvent?) -> Bool { for item in subviews{ if item.frame.contains(point){ return true } } return false }
-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event TestViewController *test=[[TestViewController alloc]init]; //实际作用就是将test的view放在window上 self.window.rootViewController=...
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch *touch = [touches anyObject]; currentPoint = [touch locationInView:self]; NSLog(@"currentPoint.x = %f",currentPoint.x); ...
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ UITouch * touch=[touches anyObject]; currentPoint =[touch locationInView:self]; UIGraphicsBeginImageContext(self.frame.size); ...
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { if (self.isHidden == NO) { CGPoint newP = [self convertPoint:point toView:self.centerButt]; if ( [self.centerButt pointInside:newP ...
1.3 IOHIDEvent -> UIEvent 1.5 UIResponder Chain 1.6 UITouch UIEvent UIResponder
事件通过UIEvent对象描述UIEvent描述了单次的用户与应用的交互行为,例如触摸屏幕会产生触摸事件,晃动手机会产生运动事件。UIEvent对象中记录了事件发生的时间,类型,对于触摸事件,还记录了一组UITouch对象,下面...
* [03_UIEvent](Assets/XLua/Examples/03_UIEvent/): 展示怎么用lua来写UI逻辑。 * [04_LuaObjectOrented](Assets/XLua/Examples/04_LuaObjectOrented/): 展示lua面向对象和C#的配合。 * [05_NoGc](Assets/XLua/...
(BOOL)continueTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event (void)endTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event (void)cancelTrackingWithEvent:(UIEvent *)event ...
Advanced Event Handling with DOM Level 2 Section 19.3. The Internet Explorer Event Model Section 19.4. The Netscape 4 Event Model Chapter 20. Compatibility Techniques Section 20.1. Platform...
resizestop已根据获得。 模拟“ resizestop”事件 window.resizeStop在窗口对象上模拟“ resizestop”事件。 这对于执行依赖于窗口大小的操作很有用,但是以一种或另一种方式却很昂贵-例如,如果频繁执行调整大小...
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [manager touchBegin:event withTouchView:self.view]; } - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event{ ...
13.3.5.2 UIEvent接口的属性 13.3.5.3 MouseEvent接口的属性 13.3.5.4 MutationEvent接口 13.3.6 混合事件模型 13.3.7 合成事件 13.4 浏览器的事件处理模型实现 13.4.1 Internet Explorer...
withEvent:(UIEvent *)event; - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event; 事件传递示例图 我们点击屏幕产生触摸事件,系统将这个事件加入到一个由UIApplication管理的事件队列中,...