Last active
February 3, 2022 08:36
-
-
Save SebastianBoldt/9f51e07905acac4471db369ba0d40f8f to your computer and use it in GitHub Desktop.
AsyncAwait.swift
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct SomeView { | |
| var data: Data? { | |
| get async throws { | |
| return await fetchData() | |
| } | |
| } | |
| func fetchData() async throws -> Data? { | |
| // .... | |
| } | |
| func loadData(_ perform: () async throws -> String) { | |
| // ..... | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment