Gestures and Touches(Chapter 8 of The iPhone™ Developer’s Cookbook)
2010-12-31 13:59
477 查看
Touches have life cycles. Each touch can pass through any of five phases that represent the progress of the touch within an interface. These phases are as follows: UITouchPhaseBegan—Starts when users touch the screen. UITouchPhaseMoved—Means a touch has moved on the screen. UITouchPhaseStationary—Indicates that a touch remains on the screen surface but that there has not been any movement since the previous event. UITouchPhaseEnded—Gets triggered when the touch is pulled away from the screen. UITouchPhaseCancelled—Occurs when the iPhone OS system stops tracking a particular touch.This usually occurs due to a system interruption, such as when the application is no longer active or the view is removed from the window. Predefined callback methods handle the start, movement, and release of touches from the screen. Corresponding to the phases you’ve already seen, the methods involved are as follows. Notice that UITouchPhaseStationary does not generate a callback. touchesBegan:withEvent:—Gets called at the starting phase of the event, as the user starts touching the screen. touchesMoved:withEvent:—Handles the movement of the fingers over time. touchesEnded:withEvent:—Concludes the touch process, where the finger or fingers are released. It provides an opportune time to clean up any work that was handled during the movement sequence. touchesCancelled:WithEvent:—Called when Cocoa Touch must respond to a system interruption of the ongoing touch event.
相关文章推荐
- Assembling Views and Animations(Chapter 6 of The iPhone™ Developer’s Cookbook)
- Introducing the iPhone SDK(Chapter 1 of The iPhone™ Developer’s Cookbook)
- Building Your First Project(Chapter 2 of The iPhone™ Developer’s Cookbook)
- Designing Interfaces(Chapter 4 of The iPhone™ Developer’s Cookbook)
- Working with view controllers(Chapter 5 of The iPhone™ Developer’s Cookbook)
- iPhone developer's Cookbook -- Chapter 1 Introduction
- MapKit and Text Input(Chapter 5 of iOS Programming: The Big Nerd Ranch Guide)
- Introduction to Languages and the Theory of Computation--Chapter 1 学习笔记
- The Anatomy of a COM Server(Chapter 2 of COM and .NET Interoperability) part1
- iOS7 Programming Cookbook-Chapter 7-Concurrency(Timer and Thread部分)
- [置顶] App审核被拒PLA 1.2问题(The Seller and Artist names ....1.2 of the Apple Developer Program License)
- BOOK REPORT:Hard Drive---------Bill Gates and the Making of the Microsoft Empire
- Creating, Updating, and Deleting Documents(Chapter 3 of MongoDB The Definitive Guild)
- 评论数据库Win A Free Copy of Packt’s Managing Multimedia and Unstructured Data in the Oracle Database e-book
- iphone developer cookbook study note-1
- Expressions and Statements(Chapter 6 of The C++ Programming Language)
- The Complete Book of Intelligence Tests: 500 Exercises to Improve, Upgrade and Enhance Your Mind Strength (The IQ Workout Series
- 【Android】【笔记】《The Android Developer’s Cook Book》第1章 安卓概览
- 【Android】【笔记】《The Android Developer’s Cook Book》第2章 应用程序基础:Activity和Intent
- Library Organization and Containers(Chapter 16 of The C++ Programming Language)