In my application am having CustomScrollView subclass of UIScrollView (I am not using UIView here) in which I have 10 images at bottom and I want to drag any image from bottom to anywhere in scrollview by making copy of it and not deleting original at bottom. BY using touchEnd , touchMoved and touchBegan functions
In my application am having CustomScrollView subclass of UIScrollView (I am not using UIView
Share
in your touch begin method you will get touch points and will be able to get
imageViewwhere touch begin. Now if you want to show moving of image view do following:UIImageViewobjectcreate a new
UIImageViewobject with same properties.This will add image in your scroll view at same place your previous image view was.
In touch move you will get your touch points
set your any of
UIImageViewobject lets saythis will show your image moving
In
thouchEnddo the same set yournewImageViewcenter at touch end position.Make sure that you set your
UIScrollViewproperties like content size and every thing as well while moving new image may have origin negative in case your center set to x=0, y=0.This will keep the previous image as it is in scroll view and create a copy of new that image while moving.
Hope this is what you looking for. If not let me know.
Note: Code may have errors as I just typed here not in xcode but you can understand what to do