gtsaousidis / DTZoomableView

A reusable control to replace UIImageView and enable images to zoom in/out.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DTZoomableView

A reusable control to replace UIImageView and enable images to zoom in/out. Used in AGPhotoBrowser photo browser and now it's written in Swift.

Install

  • copy the content of the 'DTZoomableView' folder in your project
  • import DTZoomableView.swift in your class

Usage

Example usage:

let zoomableView: DTZoomableView = DTZoomableView(frame: CGRectMake(10, 100, 300, 300))
zoomableView.image = UIImage(named: "sample_image")
self.view.addSubview(zoomableView)

You can enabled/disable zoom capability by calling the corresponding function...

zoomableView.setZoomEnabled(false)

...or check if zoom is enabled.

if zoomableView.isZoomEnabled() {
	...
}

About

A reusable control to replace UIImageView and enable images to zoom in/out.

License:MIT License


Languages

Language:Swift 100.0%