-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI/PhotoPreview #330
base: develop
Are you sure you want to change the base?
UI/PhotoPreview #330
Conversation
Sources/UI/SwiftUI/Views/PhotoPreview/PhotoPreviewConfiguration.swift
Outdated
Show resolved
Hide resolved
Sources/UI/SwiftUI/Views/PhotoPreview/PhotoPreviewConfiguration.swift
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. I would also like to see a preview of it in the Storbybook app. Can you do that within this PR please.
I've previewed the component in the Storybook app. Here is my observation:
Screen.Recording.2024-09-23.at.08.45.45.mov |
@borut-t I've made some changes to loading remote images. The issue persisted only when Kingfisher was not available. |
There is still some glitching going on... Regards to the TabView, I think this can be done with it. |
@borut-t the glitch should now be fixed 🙏 |
And they truly are. Two things:
|
@borut-t we can't use the default one since we are using |
6f1017f
to
960df31
Compare
@nagavcindriqim @borut-t can we wrap this up? Any major issues still present? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good! Can you add some more documentation in the code (in the Configuration, for example)?
b24be4f
to
bf622d1
Compare
@dejanskledar major issues should be fixed with this commit 👌 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice progress 👌
I've added a few comments about the code itself.
And have also tested out the implementation on the real device and it still feels a bit clunky when zooming in. Especially when you zoom-in and out and want to continue scrolling.
I would de-prioritise this ticket for now and we can come back latter...
|
||
// MARK: - ViewBuilders | ||
@available(iOS 16.0, *) | ||
extension PhotoPreview { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want builders to be exposed, do we?
|
||
// MARK: - Helpers | ||
@available(iOS 16.0, *) | ||
extension PhotoPreview { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we tighten access?
|
||
// MARK: - Gestures | ||
@available(iOS 16.0, *) | ||
extension PhotoPreview { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Private access?
#if canImport(Kingfisher) | ||
import Kingfisher | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove this in favour or RemoteImage
.
var remoteImageView: some View { | ||
#if canImport(Kingfisher) | ||
KFImage(item.url) | ||
.resizable() | ||
.placeholder { | ||
(item.placeholder ?? Image(uiImage: UIImage())) | ||
.resizable() | ||
} | ||
.scaledToFit() | ||
#else | ||
AsyncImage(url: item.url) { image in | ||
image | ||
.resizable() | ||
.scaledToFit() | ||
} placeholder: { | ||
ProgressView() | ||
.tint(.white) | ||
.controlSize(.large) | ||
} | ||
#endif | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we replace with RemoteImage
?
|
||
// MARK: - Helper methods | ||
@available(iOS 16.0, *) | ||
extension PhotoPreview.ItemView { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Private access?
|
||
// MARK: - Gestures | ||
@available(iOS 16.0, *) | ||
extension PhotoPreview.ItemView { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Private access?
A UI component you can use to present an image or set of images in full-screen mode.
Requirements
Closes #206