Tom G
Tom G

Reputation: 999

Adding a UIImage on a touch event iPhone

OK i am really struggling with this!

I know had to add an image to the view, i know how to record a touch event. But combining the two is proving to be an issue.

There are lots of tutorials out there on how to move an image with touch events.

But Could anyone suggest how i might complete the following:

Any advice would be highly appreciated

Upvotes: 0

Views: 2051

Answers (1)

LeonBrussels
LeonBrussels

Reputation: 2641

Supposing that you want to simply let the image appear and disappear, you could just implement the UITouch event handling methods in the UIViewController for the view that you want to intercept the touch events in. An example on how to do this can be found in the "iPhone Programming Guide: Event Handling" at:

http://developer.apple.com/IPhone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/EventHandling/EventHandling.html#//apple_ref/doc/uid/TP40007072-CH9

Once you have managed to intercept the touch events, you can simply add the UIImageView as a subview of the view you want it to appear in.

I hope that helped a bit.

Upvotes: 1

Related Questions