Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

stirfie

macrumors newbie
Original poster
Feb 11, 2012
7
0
Western Australia
Hi All

I'm just after some advice. I am working on an app that has images on the screen that a user can drag around.

I have come from a realbasic background, so my approach is as follows:

Created an object (dragObject) with properties ( uiimage, cgpoint(for the coordinates) and cgsize ).
Created an array (dragArray) of these properties

Subclassed the UIView that has a property UIImage called mainImage.

When I handle the drag, mainImage gets redrawn using dragArray in a for loop.

The UIView then gets redrawn in drawrect with mainImage.

Is this the best approach, or should I have an array of UIImageViews, where all the images on screen are handled by their own image view.

I am new to IOS so just some general advice would be appreciated

Regards
Paul
 
I've been using a uiwebview in the past with simple html/js to move pictures around. Could be an alternative for you unless for some reason you can't use a webview for your particular app.
 
UIImageView has a frame property with contains a CGPoint and CGSize. So, your dragObject seems to be duplicating it.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.