I am wanting to get the touch points in an iOS app under Delphi (preferably as an event).
Is there an interface for this that is exposed?
I found this:
Get touch points in UIScrollView through UITapGestureRecognizer.
But I would not know if its possible to convert this code.
I am trying to implement a number of on-screen sliders (audio faders) so that the user and slide their finger to move it up and down. I plan to put a transparent rectangle control over top of the sliders so that I can get multiple touch points and move more than one simultaneously.
After going down this rabbit hole about as far as possible I am sad to say that's its not possible to get multiple touch points in Delphi. This is very shortsighted and appears to be a trivial oversight by Embarcadero.
Essentially the Delphi UIView implementation does not expose the "multipleTouchEnabled" property so the touch events inside of FMX.Platform.iOS.pas will never receive more than one touch event.
I am posting this to save the next person the time that I put into find this disappointing answer.
Related
When I am doing the single tap in iOS voice over mode, it will read the tagged elment, but I want to know the tag point x and y, are there any api to get it?
You can't get this information from VoiceOver. The APIs don't support it. The closest you could get would be to grab onto the focused element, and understand that somewhere within that rectangle was the last touch point. But, even then, there would be no way to distinguish between elements focused by single touch vs elements focused "focustNext" style sequential navigation (swipe right and swipe left gestures).
I am currently working on a new project and I need to detect whether my SpriteNode has been touched or not. That is not the problem [yet]. But my SpriteNode includes an Png-Image and due to this it also includes an translucent part. And what I want to do is to "delete"/ignore this non-visible part and only detect whether the visible part has been touched. I tried it on several ways but nothing really worked. I need an reliable way to do that (Swift 4 or 3). I already read other posts but they did not help.
Or maybe you have other ways to determine an touchable area from Png-Image than using a SpriteNode.
As part of a children's application I am trying to detect a hand print on an ipad screen. I can detect touches with the touch events but ultimately the hand is going to be 1 large touch event. I am trying to detect the size and x,y position of the hand. Any ideas on whether this is even possible?
The other part of this is I am using corona sdk/lua to develop. Is the solution (if there is one) still going to be feasible, or should I look at changing to native code?
I don't know how practical this will be in native code. It sound like you could enable multi touch and on touch events you would get multiple locations. See the Multitouch sample app.
If you're on a Mac, open Finder and go to /Applications/CoronaSDK/SampleCode/Interface/ and there are three sample projects in there that involve multitouch. If you're on Windows it's C:\Program Files (x86)\CoronaSDK\SampleCode (I think).
I would like to have a tool tip show up over a set of UIImageView when a user hovers over it. I don't see see any methods to leverage that do this in the UIImageView class.
How can I accomplish this?
Tool tip support is not directly available in iOS at this time. But you can accomplish the same effect with a couple of approaches:
Using an existing tool tip framework
There are open source solutions available that solve the problem, which you can pull into your own project and use and save a lot of time, as long as you ensure the license is compatible with Apple's policies (many of them are, but require that you credit the author somewhere in your project source). You could study their code to learn the technique. For example there is AmPopTip project on github
Here's a corresponding YouTube video:
Here is a similar StackOverflow.com question (there may be more):
Is it possible to show a tooltip in an iOS app?
Trying to code it yourself
You'd probably use a long press gesture, see Apple's Gesture Recognizers documentation and perform some kind of Hit Test to determine when the finger was over UIView subview (in this case UIImageView) and then time the entry of it, and how long it was held in that view without moving out or lifted.
At that point you'd want to overlay a UITextView or a class that contained one but drew a custom border around it, containing with the tool tip by either adding it as a subview over the top or near where the finger was placed, or make it the pop up as a separate UIViewController.
I'm trying to learn iOS programming and I decided to make a game like Connect 4, or some may know it as Four in a row.
I've done the grid and dropping the tiles. However, I haven't been able to stack the tiles on top of each other. I havent tried that much because I have no idea on how i could do something like that as i have never tried making a game like this, I have also searched online but I dont know if it's my choice of wording that it never shows anything or if there isnt anything like it.
I have 7 column on the top, with a hairline where you touch in order to drop the tile to the grid. Right now the tiles just stack on each other.
Not sure if my response is worth to be an answer but what the heck...
If you are set on not getting into Sprite Kit right now, you could probably use UIButton to make this happen. Divide your screen into a grid of UIButtons. You can set the button images according to empty and played (red or blue). Each button code would have to check for things like if the hole (button) was already played, what color chip to display, is this a winning move, etc... There is of course an easier way to do this instead of copying the same code into each button but I'll let you try to figure that one out for now.