swiftui-image-viewer icon indicating copy to clipboard operation
swiftui-image-viewer copied to clipboard

Library refactor

Open skjiisa opened this issue 4 years ago • 3 comments

This pulls the different parts of the app out into their own files to reduce redundancy and to make it easier to add features in the future.

ImageViewer no longer depends on URLImage as it did not use it. ImageViewerRemote now depends on ImageViewer to reduce redundant code.

The image viewers now take details objects (ImageDetails and ImageDetailsRemote) to load images. This is to make it easier to implement a gallery mode in the future where each image can have its own unique caption and aspect ratio.

Many properties that were previously Binding or State properties were changed to be standard properties as there was no functional benefit to having their property wrapper.

These changes change the code interface and thus this pull request is not compatible with 2.0, so it would need to be made into a new major version.

skjiisa avatar Mar 31 '21 21:03 skjiisa

This has some major changes in it that I made unprompted, so feel free to make further adjustments if it's something you'd want to move forward with. The readme would also need to be rewritten which I could help with if you wanted.

skjiisa avatar Mar 31 '21 21:03 skjiisa

Thank you for all of your work on this! This is all looking great so far. It will probably take me some time to go through all of the changes and everything before merging.

Jake-Short avatar Mar 31 '21 21:03 Jake-Short

I just realized ImageDetailsRemote could be moved to a file in the remote target so it isn't included in the regular image viewer.

skjiisa avatar Apr 01 '21 23:04 skjiisa