jake-short / swiftui-image-viewer Goto Github PK
View Code? Open in Web Editor NEWImage viewer built in SwiftUI for both local and remote images.
License: MIT License
Image viewer built in SwiftUI for both local and remote images.
License: MIT License
Describe the bug
Using ImageViewerRemote
the URL string has to be a valid URL even if viewerShown is false.
To Reproduce
With these vars:
@State var selectedURL: String = ""
@State var imageSelected: Bool = false
and this in my view:
.overlay(ImageViewerRemote(imageURL: $selectedURL, viewerShown: $imageSelected))
I get an unexpected nil when unwrapping because of line 314 in ImageViewerRemote.swift (let url = URL(string: url)!
).
Expected behavior
I expect to only need a valid URL (string) in my $selectedURL
if $imageSelected
is true.
Since the selectedURL is a binding it is commonly set at some point during user interaction but won't have a meaningful value before that.
Device Information (please complete the following information):
Desktop (please complete the following information):
How can this package be treated? Please add a license. Thanks
Hi there is a problem in dependencies that make the package hard to install is the max version required for URLImage that make you impossible to install ImageViewer when URLImage has already been installed at the latest version
I got a navigation back btn on left top.
So when i using swiftui-image-viewer , the navigation back btn will cover the close btn of image viewer.
Can we custom the position of close btn ?
By the way , this image viewer helps me a lot.
Thx ! :)
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Additional context
Add any other context or screenshots about the feature request here.
Is your feature request related to a problem? Please describe.
I'd like to zoom in very deep in the image, but as the pinch end, the original gets back its original size, so I can't zoom more.
Describe the solution you'd like
An option to disable the revert back to original size.
As a bonus, an option to double tap to zoom between scaledToFit and real size (100%).
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Describe the solution you'd like
A clear and concise description of what you want to happen.
Additional context
Add any other context or screenshots about the feature request here.
I would like to use this on MacOS but it has a UIKit dependency
Hmmm, maybe Fusion? I've never worked in that though ...
Thoughts?
Is the file ContentView.swift in you library code? I had to rename my test to something else to get it to compile.
And pinch out does zoom in but on release, the image snap back to its natural size. Is this how it suppose to work? I expect it to work like the Photo app: pinch zoom to stay at the zoom size.
Hello, there are 3 print statements that are present in the SPM version that are not present in the Github repo. They are in the onEnded section of the drag gesture. They are:
print(abs(self.dragOffset.height) + abs(self.dragOffset.width))
print((abs(self.dragOffsetPredicted.height)) / (abs(self.dragOffset.height)))
print((abs(self.dragOffsetPredicted.width)) / (abs(self.dragOffset.width)))
Is your feature request related to a problem? Please describe.
No.
Describe the solution you'd like
Pass in an array of images the user can swipe to view them
Additional context
N/A
I want to do this, zoom to 0.5 and stop and zoom to 1.5 ,it will suddenly become 1.0, which is not the same as the system viewer.
Thanks.
I commented this line " case .ended: scale = 1
Describe the bug
To Reproduce
Steps to reproduce the behavior:
add caption params:
@State var imgDesc: String = "default"
...
ImageViewerRemote(imageURL: self.$imgURL, viewerShown: self.$showImageViewer, caption: Text(imgDesc), closeButtonTopRight: true)
when change imgDesc's value, the caption doesnt change, it still is 'default'
Expected behavior
caption value shoud be change to new value
I don't know if the problem occurs because of me or some kind of setting but the same image looks on low resolution on physical device but looks normal on simulator.
Screenshots
Device Information (please complete the following information):
Is your feature request related to a problem? Please describe.
This is more about user interface consistence with Apples'. It was the nice gesture of the Apple's photos to dismiss full view with zoom out.
Describe the solution you'd like
Additional context
I'm currently using this in fullScreenCover since overlay is problematic with navigation stacks.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Imageviewer should be above all (Seems like z-index issue)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.