Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-06-2010, 03:30 PM   #1 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 8
Chibisnow is on a distinguished road
Arrow Dragging a uiimageview over two scrolluiviews

So I have an app that has a hierarchy of a uiviewcontroller that has two uiscrollviews. Each one of these scrollviews has a view in itself, one of which contains an array of MapImages(uiimageviews). I essentially want the user to drag one image (the left scrollview/view combo) over to the other set of scrollview/container. Since I subclassed uiimageview for my images, the dragging motion is taken care of in the touchesmethod for each of these images. My problem, when an image is dragged from one view to another(which I want to check with the x coordinate), I cannot notify the viewcontroller to switch the image itself to the other view. I've been trying to find any function that the uiviewcontroller calls on every tick so I can check for the array of images if any of them have crossed the line to get switched over.
Unless there's another way, this is all that I can think of.

Anyway.. to say in short term, how in the world do you move a uiimageview from one scrollview to the next when bringtofront, etc. doesn't work? Apparently the scrollview that has the images is a layer behind the other scrollview but no matter which way I add them to the viewcontroller, this still happens.

Thanks in advance because my brain is fried from this mess @_@
Chibisnow is offline   Reply With Quote
Old 10-06-2010, 03:39 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

since you have a custom uiimageview subclass, you have lots of options --

1. You can post a notification in the touchesMoved on your imageview that you will respond to in your viewcontroller. In your viewcontroller, you can check the x of the imageview and move it to other scroll view if needed.

2. YOu can use delegates to accomplish #1 instead of notifications
3. You can just pass the instance of your viewcontroller directly to each image view and call some viewcontroller method from within the touchesmoved of the image view.

4. And on and on and on..
smithdale87 is offline   Reply With Quote
Old 10-06-2010, 03:55 PM   #3 (permalink)
Registered Member
 
Join Date: Oct 2010
Posts: 8
Chibisnow is on a distinguished road
Default

I guess I'm wondering where to do that check for number one, because viewdidload is only called once. I'm assuming I need to do this check in touchesMoved in the viewcontroller instead, but the touchesMoved doesn't respond if I put a printf, etc. in it. Perhaps I'm not connecting the view with the viewcontroller.. hmm.
Chibisnow is offline   Reply With Quote
Reply

Bookmarks

Tags
dragging, scrollview, uiimageview, uiimageview and uiimage

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 347
8 members and 339 guests
headkaze, mistergreen2011, nobstudio, Objective Zero, rayjeong, revg, Sloshmonster, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:13 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0