5687547

所属分类:操作系统开发
开发工具:Objective-C
文件大小:124KB
下载次数:2
上传日期:2013-12-10 10:00:45
上 传 者uirrrqqq
说明:  ios触摸事件例子全集,精选ios学习编程源码,很好的参考资料。
(IOS touch event examples complete, select learning IOS programming source code, a good reference.)

文件列表:
LICENSE.txt (11358, 2012-03-03)
Touchposé Example (0, 2012-03-03)
Touchposé Example\Resources (0, 2012-03-03)
Touchposé Example\Resources\Icon-iPad.png (8794, 2012-03-03)
Touchposé Example\Resources\Icon.png (6726, 2012-03-03)
Touchposé Example\Resources\Icon@2x.png (17321, 2012-03-03)
Touchposé Example\Resources\Touchposé.png (10126, 2012-03-03)
Touchposé Example\Resources\Touchposé@2x.png (20167, 2012-03-03)
Touchposé Example\Source (0, 2012-03-03)
Touchposé Example\Source\en.lproj (0, 2012-03-03)
Touchposé Example\Source\en.lproj\InfoPlist.strings (45, 2012-03-03)
Touchposé Example\Source\main.m (941, 2012-03-03)
Touchposé Example\Source\QAppDelegate.h (814, 2012-03-03)
Touchposé Example\Source\QAppDelegate.m (1623, 2012-03-03)
Touchposé Example\Source\QTouchposeApplication.h (880, 2012-03-03)
Touchposé Example\Source\QTouchposeApplication.m (11399, 2012-03-03)
Touchposé Example\Source\QViewController.h (660, 2012-03-03)
Touchposé Example\Source\QViewController.m (1726, 2012-03-03)
Touchposé Example\Source\Touchpose-Info.plist (1684, 2012-03-03)
Touchposé Example\Source\Touchpose-Prefix.pch (321, 2012-03-03)
Touchposé Example\Touchpose.xcodeproj (0, 2012-03-03)
Touchposé Example\Touchpose.xcodeproj\project.pbxproj (13912, 2012-03-03)
Touchposé Example\Touchpose.xcodeproj\project.xcworkspace (0, 2012-03-03)
Touchposé Example\Touchpose.xcodeproj\project.xcworkspace\contents.xcworkspacedata (154, 2012-03-03)
Touchposé screen shot.png (44493, 2012-03-03)

# Touchpose ![Touchpose with four fingers on the screen.](http://reactionsoftware.com.s3.amazonaws.com/images/Touchpos%C3%A9%20screen%20shot.png) Touchpose is a set of classes for iOS that renders screen touches when a device is connected to a mirrored display. Touchpose adds a transparent overlay to your app’s UI; all touch events cause semi-transparent circles to be rendered on the overlay--an essential tool when demoing an app with a projector (with an iPad 2 or iPhone 4S). To use Touchpose in your own app, copy `QTouchposeApplication.m` and `QTouchposeApplication.h` from the example project to your project. Touchpose should work for most apps (but read the caveat below). It’s implemented by a single public class, `QTouchposeApplication`, and several private classes. `QTouchposeApplication` overrides `‐sendEvent:` and is responsible for rendering touches on the overlay view. There are some gnarly implementation bits to ensure that the overlay view remains the top-most view in the view hierarchy. This is achieved by intercepting calls to `-didAddSubview:` and `-becomeKeyWindow` using _method swizzling_. Method swizzling is supported by the Objective-C runtime, but it’s usually considered a dangerous practice, especially when done on classes you don’t own. Furthermore, it only works if you’re the only one swizzling—if some other class is also swizzling methods on the same class, things may go amok. My recommendation is to only use this code in private builds when you want to demo your app to an audience on a projector. To use Touchpose with an app, indicate that `QTouchposeApplication` should be used instead of `UIApplication`. This is done by specifying the application class in UIApplicationMain: int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, NSStringFromClass([QTouchposeApplication class]), NSStringFromClass([QAppDelegate class])); } } That’s it; no other steps are needed. By default, touch events are only displayed when actually connected to an external device. If you want to always show touch events, set the `alwaysShowTouches` property of `QTouchposeApplication` to `YES`. ## Known Issues - When an alert view is display, touches that are initiated outside the alert view aren’t displayed. Touches inside the alert view are displayed correctly (even if moved outside the alert view). - It seems that in iOS versions earlier than 5, Touchpose interferes with the performance of the on-screen keyboard. As a workaround, Touchpose is automatically disabled when the keyboard is shown if running a version earlier than iOS 5. Note that touches are never displayed on the keyboard, even on iOS 5. This isn’t too significant, because the keyboard already has a visual effect indicating where touches occur. - The finger touch views are not always removed when a touch ends. This appears to be caused by a bug in iOS: we don't get notified of all `UITouch` instances ending. See [here](https://discussions.apple.com/thread/1507669?start=0&tstart=0) for a discussion of this issue. I haven't investigated this issue extensively—it seems to only occur on versions of iOS prior to 5. ## License Touchpose is licensed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html).

近期下载者

相关文件


收藏者