Skip to content

Instantly share code, notes, and snippets.

@laevandus
Created July 23, 2022 02:37
Embed
What would you like to do?
@MainActor
final class ViewModel: ObservableObject {
let imageProcessor = ImageProcessor()
@Published var currentImage: UIImage?
func applyEffectsToImage() {
print(#function, Thread.isMainThread, Thread.current)
Task {
print(#function, Thread.isMainThread, Thread.current)
let imageData = Data()
currentImage = await imageProcessor.process(imageData)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment