From 59ef4091fdde1c784062a768bc3add5c65411efa Mon Sep 17 00:00:00 2001 From: KAWASHIMA Yoshiyuki Date: Sun, 22 Aug 2021 00:58:11 +0900 Subject: [PATCH] Add Async ver Session refs #14 --- Documentation/Async.md | 18 ++++++++++++++++++ README.md | 3 ++- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Documentation/Async.md diff --git a/Documentation/Async.md b/Documentation/Async.md new file mode 100644 index 0000000..fc89f5f --- /dev/null +++ b/Documentation/Async.md @@ -0,0 +1,18 @@ +# 非同期処理 + +[TODO] 非同期処理の前に TableView か CollectionView を利用して複数の拠点の天気予報を表示できるようにするのはどうだろうか + +非同期処理を扱ってみましょう。 + +Async ver +```swift +static func asyncFetchWeather(_ jsonString: String, completion: @escaping (Result) -> Void) +``` +[APIの概要](YumemiWeather.md#async-ver) + +## 課題 +- 呼び出しAPIを`Async ver`に変更する +- APIの処理が戻るまで各拠点の View に天気予報取得中の UI 表示を行う + +※イメージ +![async](Images/Async.gif) diff --git a/README.md b/README.md index c2974b8..12f9b40 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,8 @@ Session1がレビュー待ちの場合... - [Session9](Documentation/ThreadBlock.md) - [Session10](Documentation/Delegate.md) - [Session11](Documentation/Closure.md) -- [Session12](Documentation/BugFix.md) +- [Session12](Documentation/Async.md) +- [Session13](Documentation/BugFix.md) **(注1)** このようなケースで `rebase` コマンドを使うことが必ずしも正しいとは限りません。