File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11# 並行処理\( Concurrency\)
22
3- 最終更新日: 2024/08/30
3+ 最終更新日: 2025/02/01
44原文: https://docs.swift.org/swift-book/LanguageGuide/Concurrency.html
55
66非同期操作を行う。
@@ -19,7 +19,7 @@ Swift の言語サポートを使用せずに並行処理を書くことは可
1919``` swift
2020listPhotos (inGallery : " 夏休み" ) { photoNames in
2121 let sortedNames = photoNames.sorted ()
22- let name = sortedNames[1 ]
22+ let name = sortedNames[0 ]
2323 downloadPhoto (named : name) { photo in
2424 show (photo)
2525 }
@@ -52,7 +52,7 @@ func listPhotos(inGallery name: String) async -> [String] {
5252``` swift
5353let photoNames = await listPhotos (inGallery : " 夏休み" )
5454let sortedNames = photoNames.sorted ()
55- let name = sortedNames[1 ]
55+ let name = sortedNames[0 ]
5656let photo = await downloadPhoto (named : name)
5757show (photo)
5858```
You can’t perform that action at this time.
0 commit comments