Created
March 26, 2021 10:50
-
-
Save Enchan1207/685378d3060becc94e7a4db712b0931e to your computer and use it in GitHub Desktop.
SPM executableでURLSessionDataTask
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
// webサイトから持ってきてパース | |
let task = URLSession.shared.dataTask(with: URL(string: "https://example.com")!) { (data, response, error) in | |
print(response) | |
semaphore.signal() | |
} | |
task.resume() | |
semaphore.wait() | |
exit(EXIT_SUCCESS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment