あなたが望むものは、Apple によって書かれたこのPhotoScroller デモにあります。私はそれを自分で使用しましたが、完全に機能します。
特に ImageScrollView モジュールを確認してください。ズームを処理します。
ズームに関する UIScrollView のヘッダーのコードは次のとおりです。
/*
the following properties and methods are for zooming. as the user tracks with two fingers, we adjust the offset and the scale of the content. When the gesture ends, you should update the content
as necessary. Note that the gesture can end and a finger could still be down. While the gesture is in progress, we do not send any tracking calls to the subview.
the delegate must implement both viewForZoomingInScrollView: and scrollViewDidEndZooming:withView:atScale: in order for zooming to work and the max/min zoom scale must be different
note that we are not scaling the actual scroll view but the 'content view' returned by the delegate. the delegate must return a subview, not the scroll view itself, from viewForZoomingInScrollview:
*/
@property(nonatomic) float minimumZoomScale; // default is 1.0
@property(nonatomic) float maximumZoomScale; // default is 1.0. must be > minimum zoom scale to enable zooming