I have UITableview showing list of images .I want to implement zoom in zoom out functionality on UIImageView inside UITableviewCell.I tried with UIPinchGestureRecognizer on table but it is not working properly.So want to implement using scrollview inside UITableviewCell,But it contradict with default scroll view of UITableview.So Any good link or tutorial to study about it???
Asked
Active
Viewed 1,073 times
0
-
what do u mean zoom in and zoom out? zoom in only the image via pan? or tap and the image animates to open as a fullscreen image. – Saheb Roy Jun 02 '17 at 08:06
-
yes only want to zoom image.In any way using UIPinchGestureRecognizer or image view inside ScrollView of UITableviewCell – Shipra Gupta Jun 02 '17 at 08:22
-
My issue is resolved by adding scrollview in UIPageViewController. where paging use to scroll down the images and scrolling is used for zoom in zoom out. – Shipra Gupta Jun 05 '17 at 11:34
2 Answers
2
Use UIImageView
in the cell, add a UIPanGesture
, set it to 2 fingers required.
On .begin
have a delegate
method send the cell to the UIViewController
, calculate the delta x/y on the gesture to calculate a value to scale the image with.
make a dummy UIImageView
with the image from the cell, use convertRect
to place in on the UIView
of the UIViewController
.
set a scale transform on the dummy UIImageView
.

Sean Lintern
- 3,103
- 22
- 28
-
dummy UIImageView means I have to add One more imageView in cell? – Shipra Gupta Jun 02 '17 at 09:10
-
make a UIimageview exact same size as the cells one, on top of where the cell is, thats why you need delegate to send cell to VC so you can convert the cells UIImgaeview rect to add the new one. – Sean Lintern Jun 02 '17 at 09:15
0
Instead of using UIImageView
use UIButton
and set image in button with out text. On button click of specific index you got action of button with Button and now zoom your button.
Take ref how to manage button in tableView : Get button click inside UI table view cell
Any further issue you can ask.

dahiya_boy
- 9,298
- 1
- 30
- 51