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 Game Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-07-2011, 05:16 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 10
tkv555 is on a distinguished road
Default UI Image View

I have 2 UIImageView objects one & two [User Action is enabled on both] and I want to know when the user clicks on it.

Can someone tell me how do I identify which UIImageview object was clicked?

My touchesBegan simply passes the control to touchesMoved and i was thinking to somehow use CGRectIntersectsRect with one.frame as one of the parameter, however I am not sure what I should use as the second parameter?

If there is another better way to do this please advise.

Thanks in advance.
tkv555 is offline   Reply With Quote
Old 09-08-2011, 08:49 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 10
tkv555 is on a distinguished road
Default

No responses so far

Come on guys and gals I know there are experienced people who can help a newbie for this simple request.

Regards
tkv555 is offline   Reply With Quote
Old 09-08-2011, 10:58 AM   #3 (permalink)
almostfunnydev
iPhone Dev SDK Supporter
 
rocotilos's Avatar
 
Join Date: Oct 2009
Age: 34
Posts: 3,015
rocotilos is on a distinguished road
Default

"My touchesBegan simply passes the control to touchesMoved"

What? I don't understand this.
You should post your code for anyone to start replying.

Also, a user does not click on anything, they tap. :P
rocotilos is offline   Reply With Quote
Old 09-08-2011, 04:49 PM   #4 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 10
tkv555 is on a distinguished road
Default

Quote:
Originally Posted by rocotilos View Post
"My touchesBegan simply passes the control to touchesMoved"

What? I don't understand this.
You should post your code for anyone to start replying.

Also, a user does not click on anything, they tap. :P
Sorry for the delay just came back from office. Here is the code

-(void) touchesBeganNSSet *)touches withEventUIEvent *)event
{
[self touchesMoved:touches withEvent:event];
}


-(void) touchesMovedNSSet *)touches withEventUIEvent *)event
{
UITouch *touch = [[event allTouches] anyObject];
CGPoint location = [touch locationInView:touch.view];
}

so the location should give me where the user clicked (oops tapped)
I am not sure how to proceed after this. Please advise.
tkv555 is offline   Reply With Quote
Old 09-09-2011, 10:48 AM   #5 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 10
tkv555 is on a distinguished road
Default

someone please help...
tkv555 is offline   Reply With Quote
Old 09-10-2011, 09:37 AM   #6 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 10
tkv555 is on a distinguished road
Default

For those looking for similar solution, Here is what I find on you tube

iPhone SDK Tutorial: Touches in a UIImageView Part 2 - YouTube
tkv555 is offline   Reply With Quote
Old 09-10-2011, 06:29 PM   #7 (permalink)
Registered Member
 
Join Date: Aug 2011
Posts: 22
Hemu is on a distinguished road
Default

Quote:
Originally Posted by tkv555 View Post
For those looking for similar solution, Here is what I find on you tube

iPhone SDK Tutorial: Touches in a UIImageView Part 2 - YouTube
Hi tkv555 thanks for posting this. I was also looking for similar solution. Thanks for sharing the info.
Btw I am looking for some code to drop an image in a certain position after dragging it (as discussed above). Do you have any ideas for me. Thanks
Hemu is offline   Reply With Quote
Old 09-12-2011, 01:34 AM   #8 (permalink)
Registered Member
 
Join Date: Sep 2011
Location: 2 Sun Ct, Norcross, GA 30092
Posts: 1
DavidStanley is on a distinguished road
Send a message via Yahoo to DavidStanley
Default

This is will useful to UI image view.

Day 2: UIImageView Animations
DavidStanley is offline   Reply With Quote
Old 09-12-2011, 02:14 PM   #9 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 10
tkv555 is on a distinguished road
Default

Quote:
Originally Posted by Hemu View Post
Hi tkv555 thanks for posting this. I was also looking for similar solution. Thanks for sharing the info.
Btw I am looking for some code to drop an image in a certain position after dragging it (as discussed above). Do you have any ideas for me. Thanks
Hemu you want to drop the image at the end position of the drag or do you want to drop it to a completely different location after the drag is over?
tkv555 is offline   Reply With Quote
Old 09-12-2011, 04:51 PM   #10 (permalink)
Registered Member
 
Join Date: Jul 2011
Posts: 10
tkv555 is on a distinguished road
Default

Quote:
Originally Posted by DavidStanley View Post
This is will useful to UI image view.

Day 2: UIImageView Animations
Thanks
tkv555 is offline   Reply With Quote
Reply

Bookmarks

Tags
uiimageview

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: 382
13 members and 369 guests
7twenty7, apatsufas, comicool, Creativ, Dalia, dansparrow, Duncan C, HemiMG, heshiming, LunarMoon, Murphy, pbart, Tomsky
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,915
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

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