mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-23 08:09:41 +01:00
Add async method.
This commit is contained in:
parent
5c1caae42c
commit
d7b3d15a2c
@ -91,6 +91,14 @@ public extension RSImage {
|
|||||||
#endif
|
#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.
|
/// Asynchronously initializes an image from data.
|
||||||
///
|
///
|
||||||
/// - Parameters:
|
/// - Parameters:
|
||||||
|
Loading…
Reference in New Issue
Block a user