Giter Site home page Giter Site logo

swiftui-image-viewer's Introduction

Hi, I'm Jake 👋


Tech I Work With 🖥

Web - React, NextJS, TypeScript

Mobile - Swift, SwiftUI, React Native


About Me 📝

I'm a developer with a passion for web and mobile development. I mainly work with React for web development. I am also learning native mobile development for iOS using Swift and SwiftUI.

Feel free to email me! 📨

swiftui-image-viewer's People

Contributors

jake-short avatar pablolp97 avatar skjiisa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

swiftui-image-viewer's Issues

Print statements in SPM version.

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)))

Can not install dependecy

Hi, I saw your creation and that's exactly what I need in my project. However, when I try to install it, XCode gives me an error.
Снимок экрана 2020-07-14 в 17 03 52
Thanks.

TabBar Problem

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Click to any image
  2. ImageViewer is not above tabBar

Expected behavior
Imageviewer should be above all (Seems like z-index issue)

Screenshots
image

  • Device/simulator: iPhone 11 Pro
  • iOS version: 13.6

Does it support to swipe to the next or pre image?

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.

Resolution difference between simulator and physical device

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

Simulator Screen Shot - iPhone SE (2nd generation)

Physical Device Screen Shot - iPhone SE (2nd generation)

Device Information (please complete the following information):

  • Device/simulator: iPhone SE (2nd generation)
  • iOS version: iOS 14.5

Can we move the close btn to right top?

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 ! :)

Support of last version of URLImage

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

How to disable the close button?

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.

ImageViewerRemote wants a valid URL too early

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):

  • Device/simulator: iPhone 12 Pro
  • iOS version: 14.3

Desktop (please complete the following information):

  • macOS: macOS 11.1
  • Xcode version: 12.3 (12C33)

Install issues

Hello, I get the following error when i try to install the package:

Screen Shot 2020-07-19 at 5 51 19 PM

I am on Xcode 11.6 and ios 13.6

Caption text doesnt response change

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

Ability to disable the automatic zoom out when pinch end.

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%).

Captions for images

Hi,
The image viewer works great! And I would like to have a small suggestion:
Is it possible to add a modifier to display captions?

Thanks!! 🎊

See attached image
simulator_screenshot_4813FDE3-B5F7-4DC3-AC11-4B671291C37D

Can stop rescaling when zooming?

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

The imageViewer should stay on zoomed scale value and should be closed with zooming when scale is 1

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

  1. The view can be zoomed in and when the magnification gesture is ended, the scaling stays - currently goes back to 1
  2. If the scale is already larger than 1, the view can be zoomed out to scale 1 whatever the .ended result is .
  3. The view can be dismissed if the current scale is 1 and zoomed out.
  4. No need to button.

Additional context

I'm currently using this in fullScreenCover since overlay is problematic with navigation stacks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.