diff --git a/Core/Sources/Core/RSImage.swift b/Core/Sources/Core/RSImage.swift index 6549f02a1..7e312031b 100644 --- a/Core/Sources/Core/RSImage.swift +++ b/Core/Sources/Core/RSImage.swift @@ -91,6 +91,14 @@ public extension RSImage { #endif } + static func image(with data: Data) async -> RSImage? { + + let task = Task.detached { () -> RSImage? in + RSImage(data: data) + } + return await task.value + } + /// Asynchronously initializes an image from data. /// /// - Parameters: