How to show all the touches on the screen to dismantle the application for the iPhone?

Now that we have the mirroring of the display on the iPad 2 (now connected ... wireless output in iOS 5), is there an easy way to display all the strokes on the screen? Would this be useful when demonstrating the application?

What I'm looking for is the ability to simply turn on some SDKs and possibly change a line of code after which all my touches will be displayed on the screen.

I saw many other ways to demonstrate applications: 1) Using a simulator along with a screen capture tool that turns your mouse cursor into a large white circle 2) Hack hacked files that can record a screen / display all strokes

However, my goal is simply to touch those displayed in a regular application running on the device itself.

+7
source share
5 answers

You can use TouchposΓ©: https://github.com/toddreed/Touchpose

+8
source

Looking at all the libraries for this, I realized that, at least in my case, they were massive overflows. I just wanted to make a video with a preview of the applications, and I just needed this for two places in my application.

So, I spent a little time and came up with the following code that you can use with a SpriteKit-based scene to turn on the scene-by-scene touchscreen display. (And, if you start from scratch, you can subclass SKScene and bake that right for use by all your scenes.)

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { UITouch *touch = [touches anyObject]; CGPoint location = [touch locationInNode:self]; SKNode *node = [self nodeAtPoint:location]; #ifdef weBeRecording // ^^ Only do this if we're building a special version for making App Previews // Could also be switched on and off by a runtime control, I suppose // Create a new SKSprite at the touch location SKSpriteNode *touchesNode = [SKSpriteNode spriteNodeWithImageNamed:@"touchMarker.png"]; touchesNode.position = location; // Initially see-through touchesNode.alpha = 0.0; // Position it above all your other nodes touchesNode.zPosition = 199; // And size it appropriately for your needs touchesNode.size = CGSizeMake(80, 80); // Add it to the scene [self addChild:touchesNode]; // And then make it fade in and out. (Adjust in and out times as needed.) SKAction *showTouch = [SKAction sequence:@[ [SKAction fadeInWithDuration:0.25], [SKAction fadeOutWithDuration:0.25], [SKAction removeFromParent] ]]; [touchesNode runAction:showTouch]; #endif /* process original touch on node here */ } 

Of course, you will need to make the touchMarker.png file yourself. I created mine in Photoshop, and it's just a simple 100x100 white circle with 50% transparency. Honestly, it took more time to get this image as soon as this happened to get the code to work. (If there is a way to attach images here, I will do it. But, um, this is my first day. Yes.)

One caveat, you will discover and save the originally affected node (stored here in the "node" variable) before you do this. If you do not, the original value will be lost, and none of your node tests will work after displaying the touch marker.

Hope this helps someone else!

Dis

+3
source

I understand that this question is old, but none of the existing solutions was enough for me. I needed something that worked out of the box with multiple windows, without the need to subclass windows or do anything.

So, I created ShowTime, which (up to Swift 4) literally just requires that you either add pod to your file or add ShowTime.swift to your target. The rest is fully automatic if you do not want to configure the default values.

https://github.com/KaneCheshire/ShowTime

Starting with Swift 4, another additional step in AppDelegate, just set ShowTime.enabled = .always or ShowTime.enabled = .debugOnly

+2
source

You will need to program custom touches in the container view and move the center of the circular view to the InView touch location.

0
source

I would probably try to capture all the strokes on KeyWindow with touchhesBegan, touchhesMoved and touchesEnded. Then you can have a transparent view lying above the application, which will then show the strokes in the appropriate place.

0
source

All Articles