Swipe to change UIViewContent - iphone

Hej folks,
I got an UIView in my application and want to implement kind of a swipe gesture. I know how I detect this gesture (touchesBegan: and touchesEnded: for example is x coordinates are distanced more than 100 pixels or something else) but I really don´t now how to animate my needs. In fact my UIView will contain subviews which are 9 UIButtons. On swipe I want to change the set of buttons programatically...any solutions out there? Primarily need the animation!
EDIT: I thought about programatically moving the buttons off-screen to the left and at the same time move the new ones on-screen from the right side. But it seems I don't really know how to realize this...isn't it too much leaking at the same time? Please give me a hint!

It's seem that you want to recreate somethings like the springboard but with button instead of icon.
I can suggest you to use UIScrollView.

why you don't load just a new view with the other button set in your window after the swipe gesture was detected?

Related

Custom UITableView Animation

Is it possible to change the scrolling on a UITableView? Such as the following?
http://dribbble.com/shots/1176252-Events-iOS7?list=users
In this example, the cells have an accordion effect to them. It's like when the user drags a cell from the top of the page down the ones underneath the dragged location pinch into it, and the ones above it pull away.
I feel like I could do this if I were just use UIView's as cells and custom animate them but I believe that I would be wasting so much making a ton of UIViews.
Any tips, or direction would be so helpful. Thanks!

I have a UI Scroll View with UIButtons on top. How do i make it scroll when they touch and drag the buttons?

I want something similar to how the iPhone homescreen works. I have my scrollview inside my main view, which scrolls to the right, but when you touch on the UIButtons, they become highlighted and dragging means they don't end up getting pressed but also the scrollview doesn't end up scrolling. It doesn't do this on the homescreen. How can i make it similar to this?
A touch-down-drag is a completely different event. Apple doesn't support this directly—you'd have to code it in—start tracking the touches using the gesture responders as soon as a touch-down-inside is detected, then scroll the same amount, and stop scrolling at a touch-up-outside (or inside). This would most likely fall under the category of unusual use of interface elements, and could very well get you rejected.
I think this is a better answer to the question:
UIScrollview with UIButtons - how to recreate springboard?

i*-sdk: Placing a bubble on top of all controls

I've got a problem thats been perplexing me for a while. I have a custom control for the iPhone sdk. When the user touches the control I want to draw a small bubble above the users touch position with some information in it. A bit like a thought bubble in a cartoon.
Initially I've done it by adding a UIView subview to the control. However if I use the control where I don't have control of the z-order, for example in a table view, then the bubble will be drawn under other controls.
I've looked around but I'm not sure how to approach this problem. Everything I've read seems to indicate that you need to know the tree structure of the controls. Ideally I'd like to apply it to some layer that sits over the window as a whole, but I'm not sure how. I've also look at core graphics but cannot see any obvious answers.
Does anyone have any ideas of perhaps something they can point me at which will help.
Thanks
If you want to add a UIView to the 'top window', you can use the application UIWindow for that.
UIWindow is a subclass of UIView, so you can just use - (void)addSubview:(UIView *)view to add the new view to the window.
[[UIApplication sharedApplication] keyWindow] addSubview:yourView];
You could try adding it as a subview of the window, though, I don't think that's the most appropriate solution.
Personally, I would add my control as a subview to whichever view (maybe a table cell) and then tell that view to bring your control to the front.
[tablecell bringSubviewToFront:myControl];
That way, when you display your bubble, it'll be on top.

Detect number of fingers in UIScrollView swipe

Questions similar to this have been asked all over, but I haven't been able to find a solution to my specific problem, so here goes.
I have a UIViewController with a UIScrollView in its view. Within the scrollview, I have a number of regular uiview subviews. I want to be able to detect whether the scrollview swipe was with one or two fingers, and to cancel the scroll and call some other method in one of those cases. Can anyone help me with this?
If you are on OS 3.2 + try giving UIGestureRecognizer a try. You can detect swipes of any number of fingers very easily.
http://developer.apple.com/iphone/library/documentation/uikit/reference/UIGestureRecognizer_Class/Reference/Reference.html

iPhone: scroll view with arbitrary page/"settling" boundaries?

I'm trying to figure out if I can get what I want out of UIScrollView through some trickery or whether I need to roll my own scroll view:
I have a series of items in row that I want to scroll through. One item should always be centered in the view, but other items should be visible to either side. In other words, I want normal scrolling and edge bouncing, but I want the deceleration when the user ends a touch to naturally settle at some specified stop point. (Actually now that I think of it, this behavior is similar to coverflow in this respect.)
I know UIScrollView doesn't do this out of the box, but does anyone have suggestions for how it might be made to do this, or if anyone's spotted any code that accomplishes something similar (I'm loathe to reimplement all the math for deceleration and edge bounce)
Thanks!
There is not a whole lot of trickery to this. Just use an UIScrollView with paging enabled. Make it the size of one of your items, and locate it where you want that item to appear. Next, disable the "Clip Subviews" option on the scroll view (either in IB, or programmatically), and you are all set.