Radio dial type functionality as seen on Where To? App - iphone

Straight forward question. I'm trying to understand UI design more and how to make it work with code. In particular there used to be an app that went through several design sessions, named Where To? by Tap Tap Tap. They had a table which they turned into a radio dial, screenshot:
(source: taptaptap.com)
My question is, is this nothing more than 22 or so images, with different states put together on top of a UIView? Each UIImageView is a button? How would something like this be put together? I'd love a tutorial on programmatically turning images into actual actions. If there's any book or blog which describes the process, that would be an ideal answer for me.
Any insight into how the above is done?

I actually think it's a single image that has it's layer rotated in response to touch events and then calculates which is the active button based on the radial distance from the original position. It's not horribly complicated code (touchset change is left or right and rotate in response to that, modify the hittest method to respect the radial deltas) but the math is more than I can do before six cups of coffee.

Related

detect coordinates of some element on image

Please tell me how to solve this problem.
Where to start and which way to go.
I have an image with some buttons :
How can i detect coordinates of blue round button for example?
The difficulty lies in the fact that these are not application buttons, but just a picture on the desktop.
I understand that this is a vast and complex question, but tell me at least the right way.
It will be useful to many people.
The first thing I can imagine is to do a desktop screen, and then try to detect pixels with blue color.
You don't need to do manual image detection because Apple's vision framework already does this. You can use it to detect rectangular regions, detect text, or recognize and image within an image, depending on your needs.
See Detecting Objects in Still Images

Using PageControl?

I have an array and lets say I have 5 objects in it. The array just contains a string with an address to a picture. I would like to use the Page Control feature in the iPhone SDK to swipe Left and Right to change the picture. I already have the multitouch gestures in place all I need is to implement the Page Control so if I swipe left and then right it will take me back to the previous image.
Does anyone know of any good Page Control tutorials or sample code online that may be able to help me thought implementing the Page Control.
The UIPageControl isn't a control as much as it's just an indication of what "page" your on.
To do what you want, you need to set up a UIScrollView and add subviews for each image. It will require some math to figure out where each "page" starts and ends based on image dimensions and screen sizes.
Apple has some docs on using scroll views with page controls here.
Indeed, you need a UIScrollView along with the UIPageControl. You can find a good tutorial on how to make them work together here

drawing a line from gesture between 2 buttons

I am beginner for interactions on iphone. I have 3 buttons, one on the left, and the 2 other ones on the right. I would like to push the left button with finger and display a line real time stretching with my finger moving on screen that goes to the other button I am going to go to on the right - and then I reach the button on the right and release my finger the line stays on screen.
Where should I start in the manual to understand how to do something like this?
- please don't say page 1 ;-)
thanks for all the pointers so I can learn and write the code myself
Cheers,
geebee
Wow, uh, you're jumping right into the deep end.
First, the answer to your question is ... check out the Sample Code at developer.apple.com. By playing with those sample projects, and running them in the debugger, and reading that code, you can learn a whole lot about what you're trying to do.
Using those samples as your tutorial, refer to specific information in the reference docs also available at developer.apple.com. There are specific docs on the classes you'll be using (e.g. UIButton Class Reference), and there are high level guides that talk about different areas, like the Event Handling Guide for iOS, and Drawing and Printing Guide for iOS.
Here are some of the issues you're going to face, and some of the areas that you should read up on:
UIButtons are going to respond to your touch and won't allow any other view to receive that touch without some special handling in your code.
Check out samples that deal with UITouch events, Quartz 2D drawing, creating custom controls
Try doing this without any buttons first, that's fairly simple. Just figure out how to detect a TouchDownInside event, track the finger movement across the screen, and detect a TouchUpInside event, all in a normal UIView. (There may be a sample for this.)

iphone image carousel

I hardly know how to explain my case other than to point to the excellent Absolute vodka app, Drink Spiration.
I am trying to make a carousel like image browsing with a little spice. I would really like to find a simple core animation explanation on how to accomplish something like the above app.
I hope someone can help with this. The solution doesn't have to be exactly the same, but just explain what is happening and it would be best if it was simple and no opengl. Just something to point me in the right direction. I don't think using just a scrollview with uiimageviews is enough.
I wrote something similar and its quite easy once you figure it out in your mind. All done justing using regular old views and animating transforms on them.
Say its 3 images on screen, and you can rotate new ones on and off ... then you will need 5 views set up (most simply just a UIImageView with a relevant image set). They are the currently selected image, the two either side of it and the ones that are, or will be animating on or off when the user flicks left or right.
Each of these 5 images has a position, an angle and an image. When the user flicks left or right each gets animated to the next position and angle, views that are about to come onscreen have their image updated to the next image in the set. If the user keeps on flicking in the same direction you simply reposition views on one side as they come off the other.
With this setup you can do lots of cool carousel like things very simply.

2 buttons having the same functionality in iphone application

I am creating an application with call functionality, I want to have the phone image on the right hand side and the name of the contact on the left hand side. Currently this has been implemented by placing the 2 buttons side by side, hence if the user clicks on any of the buttons, the same functionality (calling the contact) happens.
Is this allowed according to Apple HIG? Please let me know.
Thank You,
Ashvin
I don't think anything in the HIG specifically disallows this, but it seems like a bad idea, for a couple of reasons:
If there are two buttons side-by-side, users will assume the buttons do different things, and will be confused when they don't.
It wastes screen real-estate that could probably be put to better use.
From your description it is hard to tell exactly what this looks like, but it sounds like something that needs to be re-designed.
Overlapping buttons?
It might not give you an intuitive UI, as the content of the overlapped button might get truncated by the overlapping button.
As Kristopher has explained, it will result in a bad user experience.
It is possible, that your app might get rejected because of the truncations as the user will not be readily able to perceive the content.
If look of the button is what you are concerned about, then you can just set one image (whether odd shaped or not) to one button, as long as the user is able to perceive that it is a button.
In the odd shaped image, you should also ensure that the functionality does not get triggered when the user touches the transparent area of the image, otherwise it might confuse the user.
Hope these points help!
Is there any mention about overlapping the buttons? Suppose for better design/look and feel, I have to place two buttons which partially overlaps each other, is it disallowed? Still the screen looks good and there will not be any confusion about the buttons. But only point is they are two different buttons, which assumes same functionality and has overlapped.
Adding some more information on the about query.
The buttons are overlapping as one is just a graphics and another is a rounded rectangle button whose Title changes dynamically.
If they can not be overlapped, can we have an odd shape button on the screen as long as user feels that they are buttons?
Thanks.