iOS Swipe Gesture Recogniser for a quick-paced game - ios

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

Related

Disable iOS "Perspective Compensation" programmatically?

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.

Stop voiceover reading a text

I have a long text on my view, when I tap on it VoiceOver reads the text.
Is there a default behavior to stop VoiceOver reading?
If not, is there a way to do it programmatically? for example when the view receive a tap.
Thanks in advance.
Without knowing the content or the interface it is difficult to give a solid answer to this question but one way to approach this problem it to try to not think of the experiences between a VoiceOver user and any other user as different experiences in the first place.
If you don't want VoiceOver users to repeatedly hear a long string of text you probably are also making the assumption that other users are going to be skipping over it after they have read it once as well.
Consider altering your interface so that the information is only presented once in a flow or is only presented when the user needs it and requests it, like contextual help.
Again, not knowing the interface or the purpose of the text makes it hard to answer this question directly but I generally find that building one interface to be inclusive of everyone often helps to point out that what might be perceived as just an Accessibility concern is actually a broader user experience concern and not just confined to the VoiceOver interface.
I hope that helps a little bit.

Timeline object type for GarageBand-type UI?

I'm working on a timeline app that needs to have a Garageband-type interface. I'm not a new developer, and I have a background in CGI and have been a Mac dev for over 20 years, but I'm a little stuck on what kind of objects to make that would represent the objects in the timeline. Are they UIViews? Drawn with QuartzCore? I Googled the heck out of the concept and looked at some books and came up empty. Any ideas on how to make these objects? I'd rather ask then start in one direction and realize there could be a better way down the road. Thanks.
Given that they allow user interaction, they're probably implemented as custom UIView subclasses. Since views are layer-backed, and since the timeline isn't flying all over the place and doing crazy complex animations, there's not really a good reason to have the UI be built directly from layers.

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.

How can I get a slot machine effect in the IOS SDK with text?

I need to create a list of words then have the words cycle through in a slot machine effect when swiped from top to bottom.
the only issues I'm having problems figuring out is the scrolling text part. UIPICKERVIEW doesn't cycle around (plus I need to only show one option at a time). I've hunted for examples and/or tutorials regarding this but haven't found anything that points me in the right direct.
Anyone know of a tutorial or have suggestions where I can get started or further my research? thanks.
You could use iCarousel for this:
https://github.com/nicklockwood/iCarousel
Run the Basic iOS Demo and select the Cylinder carousel type in vertical orientation with wrap on. If that looks like what you want, the documentation will explain how you can set it up in your project.

Resources