A subclass of the UIScrollView tweaked for image preview with zooming, scrolling and rotation support.
When you need to incorporate an image preview into your application, usually you start with the UIScrollView and then spend hours tweaking it to get functionality similar to the default Photos app. This control provides you out-of-the-box functionality to zoom, scroll and rotate an UIImageView attached to it.
To run the example project, clone the repo, and run pod install
from the Example directory first.
ISVImageScrollView is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'ISVImageScrollView'
ISVImageScrollView is also available via the Swift Package Manager.
ISVImageScrollView is very easy to use.
let image = UIImage(named: "Photo.jpg")
self.imageView = UIImageView(image: image)
self.imageScrollView.imageView = self.imageView
self.imageScrollView.maximumZoomScale = 4.0
self.imageScrollView.delegate = self
func viewForZooming(in scrollView: UIScrollView) -> UIView? {
return self.imageView
}
Yurii Kupratsevych
ISVImageScrollView is available under the MIT license. See the LICENSE file for more info.
link |
Stars: 32 |
Last commit: 2 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics