Created
May 31, 2021 07:37
-
-
Save alfianlosari/4d4925b3e235480a5c15564901231d5d to your computer and use it in GitHub Desktop.
Detach on sync main
This file contains 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
static func main() { | |
detach { | |
do { | |
let ipifyResponse: IpifyResponse = try await fetchAPI(url: IpifyResponse.url) | |
//... | |
} catch { | |
print(error.localizedDescription) | |
} | |
} | |
RunLoop.main.run(until: Date.distantFuture) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment