I remember that one of the WWDC 2011 videos that dealt with scrollview had a demo, where the presenter (Eliza) demonstrated how to infinitely scroll along a scrollview. The demo used a bunch of pre-generated houses and the moon.
Here's the link to the slides, but I do not see the houses demo, or related code. http://adcdownload.apple.com//wwdc_2011/adc_on_itunes__wwdc11_sessions__pdf/104_advanced_scroll_view_techniques.pdf
here's the code that they have available, but this is not the demo with the houses and the moon: http://developer.apple.com/library/ios/samplecode/StreetScroller/Introduction/Intro.html
The thing that interests me from that demo is how Eliza was able to pick up the moon with a long press and position it anywhere on the UIScrollView. I would like to add a similar technique to my app.
I've checked the source code for the advanced scrollview techniques, and it does not have that example.
Can anyone help me find out how to pick up a UIControl and drag and position it anywhere within a hosting view using longpress?
Update:
I found this code:
[button addTarget:self action:@selector(draggedOut:withEvent: ) forControlEvents: UIControlEventTouchDragOutside | UIControlEventTouchDragInside];
- (void) draggedOut: (UIControl *) c withEvent: (UIEvent *) ev {
c.center = [[[ev allTouches] anyObject] locationInView:self.markerView];
}
This picks up and positions the button, however, the button also gets activated as a result of the touch. The drag event begins almost immediately, while I would like to have at least a second of delay and a scaling effect to indicate that the button has been selected.
Any help is appreciated!