views:

289

answers:

1

I have an iPhone tabbar application with "n" number tabs. I'd like to have a UIpagecontrol in place so I could swipe between tabs. Could anyone tell me how I could do this? Examples are very helpful.

Much appreciated.

+2  A: 

You should double check if UIPageController is the correct way to do this with the iPhone UI Guidelines. I think that is more for having several pages in one tab instead of switching between the tabs and that they are not usually used together. Would seem a bit weird to have those white dots appearing :)

If you still want to flick between the views instead of using the buttons in the tab bar you could just quite easily listen for the touch swipe events and change view when you detect one. You can do this by implementing these methods:

(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;

See the iPhone Cocoa Fundamentals Guide for how to detect drag and swipe gestures.

willcodejavaforfood
I understand that is the way to register gestures, but how would I go about setting the start, duration, and end of the gestures and culminating an action (a new tab)? A simple example would be very helpful. The iPhone Fundamentals Guide shows how to track touches, but not the loading of an actual tab.
intl