Comments (4)
The only holdout is not being able to use StateObject. I'm not sure there are any good ways to replicate it behavior.
from nukeui.
You can use ObservedObject and get most of it, im sure some things won't work, or be doable, but its better than none.
struct RemoteImageView: View {
@ObservedObject var image: FetchImage
let imageUrl: URL
var contentMode: ContentMode = .fill
public var body: some View {
ZStack {
image.view?
.resizable()
.aspectRatio(contentMode: contentMode)
}
.onAppear { image.load(imageUrl) }
.onDisappear { image.reset() }
}
}
@available(iOS 14, *)
struct RemoteRetainedImageView: View {
@StateObject private var retainedImage = FetchImage()
let imageUrl: URL
var contentMode: ContentMode = .fill
public var body: some View {
ZStack {
retainedImage.view?
.resizable()
.aspectRatio(contentMode: contentMode)
}
.onAppear { retainedImage.load(imageUrl) }
.onDisappear { retainedImage.reset() }
}
}
from nukeui.
I received multiple reports about issues when using @ObservedObject
this way. Unless you make sure you retain the object (FetchImage
) somewhere, you are going to run into problems.
from nukeui.
All good. We dropped support for 13
from nukeui.
Related Issues (20)
- Question: How can we stop animations when image is displayed. HOT 2
- Can we add play and pause buttons to the video playback? HOT 3
- Add support for iOS 13 HOT 1
- Placeholder image always displayed before cached image on iOS 15 when using an animation modifier
- LazyImage and memory usage HOT 2
- LazyImage in List elements HOT 3
- Read Image Data
- Image goes black when using SwiftUI contextMenu HOT 2
- Nothing shows when using content closure & url points to a video HOT 1
- Issue loading gif HOT 1
- Crash IOS 14.4 HOT 2
- Randomly, image does not load HOT 12
- To not set const image height
- Failed to decode image HOT 1
- Unable to change default view/color while image is loading HOT 1
- NukeUI + Introspect issue HOT 5
- MP4 loop stops when app is put in background HOT 2
- [Question] Disk caching between sessions? HOT 2
- Dependency on Gifu HOT 1
- Unable to add package HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nukeui.