8

I want my entire UICollectionView zoomable including all the items in it.

I tried the delegate method func viewForZooming(in scrollView: UIScrollView) -> UIView? as UICollectionView falls under UIScrollView hierarchy. Unfortunately, this method doesn't get triggered for a collectionview.

then I tried putting my collection view inside a UIScrollView ---> contentView(UIView).

func viewForZooming(in scrollView: UIScrollView) -> UIView? {
   return self.contentView //The content view holds the collection
}

Note: UICollectionView is subview of UIScrollView's contentView. UIScrollView's maximumZoomScale was set to 3.0. It is zooming now but it isn't working as excepted. After zooming the content, the collection view contents are not properly scrollable in the zoomed state.

Any help will be greatly appreciated.

  • What do you mean by not properly scrollable? I think it is the default scroll of ScrollView in the zoomed state and not your collectionView. – Shivam Mishra Jan 13 '17 at 08:00

0 Answers0