     }
     
     private func prepareToResize() {
-        let boundsCenter = CGPoint(x: CGRectGetMidX(bounds), y: CGRectGetMidY(bounds))
-        pointToCenterAfterResize = convertPoint(boundsCenter, toView: zoomView)
+        let boundsCenter = CGPoint(x: bounds.midX, y: bounds.midY)
+        pointToCenterAfterResize = convert(boundsCenter, to: zoomView)
         
         scaleToRestoreAfterResize = zoomScale
         

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

    }
    
    private func maximumContentOffset() -> CGPoint {
        return CGPoint(x: contentSize.width - bounds.width,y:contentSize.height - bounds.height)
    }
    
    private func minimumContentOffset() -> CGPoint {
        return CGPoint.zero
    }

    // MARK: - Display image
    
    public func displayImage(image: UIImage) {
