mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-22 23:58:36 +01:00
Add async method.
This commit is contained in:
parent
5c1caae42c
commit
d7b3d15a2c
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user