有人可以向我解释这段代码吗?这是用于使用Swift在iOS应用中缩放图像,但我不明白为什么它正在工作
let scrollViewSize = scrollView.bounds.size
let w = scrollViewSize.width / newZoomScale
let h = scrollViewSize.height / newZoomScale
let x = pointInView.x - (w / 2.0)
let y = pointInView.y - (h / 2.0)
let rectToZoomTo = CGRectMake(x, y, w, h);
scrollView.zoomToRect(rectToZoomTo, animated: true)
作为致敬,这段代码片段来自ray wanderlich教程