Disable iOS "Perspective Compensation" programmatically? - ios

Maybe I'm just searching for the wrong term, but I've been able to find very little information on this subject, and I think it could be a problem for my app.
A while back, there was an article on the accuracy of the touch screens on iOS devices, and it seemed quite poor compared to other phones. Here is a link a posting about it:
http://forums.macrumors.com/showthread.php?t=1660713
Anyway, many of the commenters referred to "perspective compensation" as a cause for the inaccuracy. Basically, they are saying that iOS intentionally registers touches above the actual point of contact to compensate for the typical viewing angle of the user or for the angle of their finger or something like that. I have found that there is some credibility to that claim myself by doing as one of the commenters suggested and trying to use my iPhone upside down. I did find that it was difficult to touch things in some cases, and I have also noticed this problem in one of the apps I'm developing.
So, in case you want to skip all that rambling above, here is why it's a problem for me:
I am developing an app that is intended to be used by two people at the same time. The iPhone or iPad is placed on a surface between two people who are sitting across from one another, and they are instructed to quickly and accurately touch items on their respective halves of the screen competitively. What the article's comments made me suspect might happen, and what I have also found in practice is that the person using the phone upside down will have trouble touching buttons and dots on their first try. I've also tested slowly with a stylus and found that the touchable area of a button does indeed extend below a button, or above the button for the person using the phone upside down, hence the discrepancy and problem/disadvantage for that person.
So finally, if you want to skip that also, here is my question: Can "perspective compensation"(if that's what it's called) be disabled programmatically, and can it be done for specific views of an app? Have any of you noticed this and dealt with it in an app of yours?
While I have found that "perspective compensation" does seem to be occurring, I have not found any official documentation of it, and therefore have no idea how or if it can be disabled. When I search for "perspective compensation," the only results I find are links to the same article and comments.
I can't help but expect that this may have been asked before or is solvable with a simple checkbox, but perhaps for lack of the correct term to use, I have been unable to find any leads.
Thanks in advance for any of your solutions or suggestions!

This can't be done with the current SDK. All we have access to is the touch location, which is at a single point. Other search terms you might try are "digitizer" or "raw touch data", but there is definitely no check box or simple option.
To implement this, you will have to compensate for the touch location yourself. You'll need to play around with a compensating offset value for the upside-down buttons. Hit testing on views is probably the best place to do this, then your buttons can just respond to events as normal.

Related

iOS Swipe Gesture Recogniser for a quick-paced game

I'm new to the iOS development world, so I'm starting off with a game that's neither Clash of Clans or the infamous 'I'm Rich'. I know Python and HTML/CSS so I will be able to cope with computer terms, but it would be great if you would be able to explain any answers.
A pattern flashes on the screen for half a second, let's say it is 'arrow left, arrow right, arrow left' (in picture form). Then the user has to replicate the pattern (in the right order) in order to boost forward. Basically, I'm asking what would be the simplest/most effective way of programming this? It would be great if I could easily add more patterns.
One way I thought that it could be done is to have an ID for each pattern, in which there are pre-defined 'nodes' that have to be swiped in a particular order. One benefit to this idea is that I can add patterns, however it could take a while to program them. Another idea I had is to assign an 'eraser' to the user's brush and it will detect when +-95% of the pattern is swiped. However, this would allow the user to swipe in any order.
Perhaps there is something super easy that I can do, but at the moment I have no idea. It would be great if I could do this in Apple Swift, however Objective-C is not a problem.
Thank you in advance,
Will
You basically answered your own question in the title. Take a look at the UISwipeGestureRecognizer documentation. From there you'd just want to push gestures into an array and then compare to existing pattern arrays

What approach should I take in developing simple animation based iOS game

My question here is not about how to achieve something, but what all to include that would have the best effect for the content I am presenting.
I am designing an app (probably with single screen) which is story based. Not a story, but a scenario, to say. A typical scenario is driving through the street, going to office or both in one. And so on.
Upon each tap (or any user activity), next step of the scenario will reveal itself. Like meeting a person, colliding with a car and so on. But since these scenarios are virtually infinite, it is not possible to design graphics for my app. To say in other words, it won't be an office, an attic, a castle or a house. It can be any of that, or a combination of them.
Due to this limitation, and partially my laziness to deal with a lot of graphics (I don't have a subordinate, nor big bucks!), I have decided to do some simple animation upon each tap. A single object (like a ball) can roll or emerge from nowhere etc.
My questions:
1) Optional: How do I achieve this animation? I know objective c but I do not know if it suffice. Box2d is other option that I know of. Is it ok or an overkill? If objective c suffices, can anyone help me with simple code that will animate a rolling ball from far (center of the iphone)?
2) Required: Above is something I can figure out by myself, but this is more important: How do I devise my other UI to describe the scene and situation? What all iOS features would fit the best in situation? I can think of single UILabel to describe situation, but I do not know how I can position/animate it along with 1 above. Again, this seems far too simplistic however. Are there other iOS views that could help me?
Sorry for somewhat ambiguous requirement, but I am facing lack of imagination here, and I know if I am misled at this step, a lot of things can go wrong.
Thank you for your assistance.

Multiple UIWebViews out of memory warning

I am working with some developers who are creating an iOS 5 iPad app for us. I am familiar with coding but my no means an expert. The developers have hit a wall in their code and so I am turning to you guys to check, that there really isn't anything left to try to resolve this problem, before we give up. I've looked around and can't seem to find a straight forward resolution anywhere else, so here's the question to you guys:
The App always has to have four UIWebViews loaded. The UIWebViews need to be able to contain any website out there, be it YouTube, or whatever you can think of (i.e. something like tabbed browsing). We've tried having them on screen and off screen but either way we always run into memory problems.
I know looking to Safari isn't helpful as it's created by the mothership directly, but we're only talking about four UIWebViews here, surely this shouldn't be such a problem? Any ideas...?
Many thanks,
M
There is only one true solution: Create your own equivalent to UIWebView that has only the features that you need, and therefore has a much smaller footprint than Apple's class. I've written such a thing, but it is not public, sorry.

iPad Music app like interface

I'm making internet radio app for iPad and I was wondering if there are standard or custom implementations of iPad Music app-like interface. I mean thumbnails of albums and when you tap on a thumbnail - cover animation and presenting another controller. Is there something for that? Thanks a lot
Nope. There are bits and pieces of code that don't really work (those are all separate links), but they're a good start for getting something like coverflow working.
Also, you might want to try showing examples of what you have already found in your searching, or any code/UI you've already implemented. Most people on SO are happy to help, but don't take well to 'I haven't put any effort into this yet, please show me all the code I need for my project'. Even if you have put effort in, if you post a 2 sentence question with no demonstrable work, people will assume the worst. Best of luck.

Ti.UI.iPad.SplitWindow update layout or hide/show detailView on orientationchange?

When using the Ti.UI.iPad.SplitWindow what is the best(cleanest looking) way to update the detailView?
The options I can think of are changing the positions of elements in the detailView event or to show()/hide() vs open()/close() on an orientationchange event. I know that using the native UI components on the iPad should dynamically update to the layout width/height of the iPad but in my case the content on each detailView will have it's child objects positions updated on orientationchange. I'm just trying to get the smoothest from your all experiences. Even if I have to build custom animations I just want to start this correct from the beginning so no current code exists yet. Thus none included.
I'm hoping this isn't a duplicate as I searched before I ask but there are no Titanium based questions on this topic I can find. Possible but still different to what I'm asking.
The smoothest experience will be delivered by changing the least. I don't know what animations you are envisioning, but I would nudge you towards keeping it simple.
Here's a quick example of an orientation change in an iPad app I built recently. I had a bunch of images in a view with layout: 'horizontal'. Due to a nice bug, the images wrapped automatically. When the user reoriented the device, I animated the width of the view, and the images automatically and animatedly resorted themselves.
I've also had some clients at a large corporation get their hearts set on really complicated changes to the layout whenever the user reoriented the device. This resulted in a really unsatisfactory app that took 10-20 seconds to reorient. We made a lot of optimizations, and a lot of improvements in both their code and the underlying framework, but the heart of the problem was the complex design.
Take the time to consider if you really need complicated changes every time the user reorients, and how much benefit you are offering to your users. Also consider the cost to the user (not just to the device) of presenting them with a new UI.
Past that, you're probably not going to get too many answers until you put some experimentation in to this. If you come back with some code and some questions to go along with it, I can reformulate my answer to better pinpoint your situation.
Hope this helps! -Dawson

Resources