-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,13 +59,14 @@ import Gravatar | |
|
||
// [...] | ||
|
||
avatarImageView.gravatar.setImage(email: "[email protected]") { result in | ||
switch result { | ||
case .success(let result): | ||
print("The image view is already displaying the avatar! 🎉") | ||
case .failure(let error): | ||
print(error) | ||
} | ||
let avatarImageView = UIImageView() | ||
|
||
do { | ||
try await avatarImageView.gravatar.setImage( | ||
avatarID: .email("[email protected]") | ||
) | ||
} catch { | ||
print(error) | ||
} | ||
``` | ||
|
||
|
@@ -84,8 +85,8 @@ func fetchAvatar(with email: String) async { | |
let service = AvatarService() | ||
|
||
do { | ||
let result = try await service.fetchImage(with: email) | ||
updateAvatar(with: result.image) | ||
let result = try await service.fetchImage(with: .email(email)) | ||
updateAvatar(with: result.image) | ||
} catch { | ||
print(error) | ||
} | ||
|