Swiftpack.co - rushairer/ZoomableImageView as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by rushairer.
rushairer/ZoomableImageView 1.0.2
Simple SwiftUI ImageView that enables dragging and zooming.
⭐️ 9
🕓 2 years ago
iOS tvOS
.package(url: "https://github.com/rushairer/ZoomableImageView.git", from: "1.0.2")

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)

GitHub

link
Stars: 9
Last commit: 2 years ago
Advertisement: IndiePitcher.com - Cold Email Software for Startups

Release Notes

Release v1.0.2
2 years ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics