Skip to content

Instantly share code, notes, and snippets.

@christianselig
Created August 10, 2023 23:39
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save christianselig/e14ff9a5226f0fccda6c21f13d733af2 to your computer and use it in GitHub Desktop.
Save christianselig/e14ff9a5226f0fccda6c21f13d733af2 to your computer and use it in GitHub Desktop.
Adds async await support to WidgetCenter configuration fetch
import WidgetKit
extension WidgetCenter {
func currentConfigurations() async throws -> [WidgetInfo] {
try await withCheckedThrowingContinuation { continuation in
getCurrentConfigurations { result in
continuation.resume(with: result)
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment