Post

Replies

Boosts

Views

Activity

Add a UIImage to a Plane in RealityKit
I'm trying to dynamically add a UIImage that is in memory (that is dynamically created at runtime and changed over time) to a RealityKit scene. I see with TextureResource that I can easily do this by creating a material from an image file in my bundle, but I don't see any way to do this with just a UIImage. Is there another way to go about this that I'm just missing? Any help would be appreciated!
4
0
3.0k
Mar ’22
Download progress when using URLSession.shared.dataTaskPublisher
I'm downloading files using a dataTaskPublisher - and the actual download is going great. What I'm wondering is if there is any way to show the "percent downloaded"? Here's my code: cancellable = URLSession.shared.dataTaskPublisher(for: url)     .map { UIImage(data: $0.data) }     .replaceError(with: nil)     .handleEvents(receiveSubscription: { [weak self] _ in self?.onStart() },                   receiveOutput: { [weak self] in self?.cache($0, id) },                   receiveCompletion: { [weak self] _ in self?.onFinish() },                   receiveCancel: { [weak self] in self?.onFinish() })     .subscribe(on: Self.imageProcessingQueue)     .receive(on: DispatchQueue.main)     .sink { [weak self] in             self?.image = $0     }
1
0
933
Mar ’21