mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add async method.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user