     }
     
     private func maximumContentOffset() -> CGPoint {
-        return CGPointMake(contentSize.width - bounds.width, contentSize.height - bounds.height)
+        return CGPoint(x: contentSize.width - bounds.width,y:contentSize.height - bounds.height)
     }
     
     private func minimumContentOffset() -> CGPoint {
-        return CGPointZero
-    }
-
-    // MARK: - UIScrollViewDelegate
-    
-    public func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView? {
-        return zoomView
-    }
-    
-    public func scrollViewDidZoom(scrollView: UIScrollView) {
-        adjustFrameToCenter()
-    }
-    
+        return CGPoint.zero
+    }
+
     // MARK: - Display image
     
     public func displayImage(image: UIImage) {

        // restore center point, first making sure it is within the allowable range.
        
        // convert our desired center point back to our own coordinate space
        let boundsCenter = convertPoint(pointToCenterAfterResize, toView: zoomView)
        
        // calculate the content offset that would yield that center point
        var offset = CGPoint(x: boundsCenter.x - bounds.size.width/2.0, y: boundsCenter.y - bounds.size.height/2.0)

    
    public func refresh() {
        if let image = zoomView?.image {
            displayImage(image: image)
        }
    }
}

extension ImageScrollView: UIScrollViewDelegate{
    
    public func viewForZooming(in scrollView: UIScrollView) -> UIView? {
        return zoomView
    }
    
    public func scrollViewDidZoom(_ scrollView: UIScrollView) {
        adjustFrameToCenter()
    }
    
}
