ZoomableImageView

1.0.2

Simple SwiftUI ImageView that enables dragging and zooming.
rushairer/ZoomableImageView

What's New

Release v1.0.2

2021-10-19T16:29:50Z

ZoomableImageView

GitHub code size in bytes GitHub GitHub release (latest by date including pre-releases) GitHub tag (latest by date)

Simple SwiftUI ImageView that enables dragging and zooming.

Declaration

struct ZoomableImageView

Overview

Double Tap the view will zoom-in.

ZoomableImageView(image: UIImage(systemName: "photo")!)
@State var image: UIImage = UIImage()

var body: some View {
    ZoomableImageView(image: image, maximumZoomScale: 10)
        .task {
            do {
                let url = URL(string: "https://apod.nasa.gov/apod/image/2108/PlutoEnhancedHiRes_NewHorizons_960.jpg")!
                let (imageLocalURL, _) = try await URLSession.shared.download(from: url)
                let imageData = try Data(contentsOf: imageLocalURL)
                image = UIImage(data: imageData)!
            } catch {
                print(error)
            }
        }
}

History

History

LICENSE

The MIT License (MIT)

Description

  • Swift Tools 5.5.0
View More Packages from this Author

Dependencies

  • None
Last updated: Sat Nov 09 2024 20:54:40 GMT-1000 (Hawaii-Aleutian Standard Time)