How to enable zoom in UIScrollView

前端 未结 4 444
小蘑菇
小蘑菇 2020-12-01 09:03

How do I enable zooming in a UIScrollView?

4条回答
  •  离开以前
    2020-12-01 09:20

    Make sure you set your viewController as the scrollViews delegate and implement:

    func viewForZooming(in scrollView: UIScrollView) -> UIView? {
        return imageView
    }
    

提交回复
热议问题