Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

エラーハンドリングに Delegate を絡める #34

Merged
merged 1 commit into from
Sep 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Documentation/Error.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ Swiftにはベースになる考え方があります。

## 課題
- 呼び出しAPIを`Throws ver`に変更する
- エラーを Delegate で受け取る
- 天気予報を画面に表示する
- APIエラーが発生したらUIAlertControllerを表示する
- エラーの内容に応じてメッセージを変更する
メッセージの内容は自由です。エラーを切り分けられていればOK。

## ヒント
- CLLocationDelegate の例だと、 [locationManager(_:didFailWithError:)](https://developer.apple.com/documentation/corelocation/cllocationmanagerdelegate/1423786-locationmanager) でエラーを受け取ります