-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove Gravatar related deprecated types and replace with Gravatar SDK (
#23429) * Remove & replace Gravatar related deprecated code * Add Gravatar SPM packages to WPAuthenticator target * Pass preferred size * Revert "Add Gravatar SPM packages to WPAuthenticator target" This reverts commit 81adf3d. * Add Gravatar as dependency to WPAuthenticator in Package.swift * Add `listenForGravatarChanges(...)` * Add default placeholder like the removed method * Remove sha256Hash
- Loading branch information
Showing
9 changed files
with
35 additions
and
279 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
148 changes: 0 additions & 148 deletions
148
Modules/Sources/WordPressUI/Extensions/Gravatar/Gravatar.swift
This file was deleted.
Oops, something went wrong.
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
7 changes: 0 additions & 7 deletions
7
Modules/Sources/WordPressUIObjC/Extensions/NSString+Gravatar.h
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
Modules/Sources/WordPressUIObjC/Extensions/NSString+Gravatar.m
This file was deleted.
Oops, something went wrong.
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
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
22 changes: 22 additions & 0 deletions
22
WordPressAuthenticator/Sources/Signin/UIImageView+Additions.swift
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import UIKit | ||
import WordPressUI | ||
import GravatarUI | ||
|
||
extension UIImageView { | ||
func setGravatarImage(with email: String, placeholder: UIImage = .gravatarPlaceholderImage, rating: Rating = .general, preferredSize: CGSize? = nil) async throws { | ||
var options: [ImageSettingOption]? | ||
if let cache = WordPressUI.ImageCache.shared as? Gravatar.ImageCaching { | ||
options = [.imageCache(cache)] | ||
} | ||
else { | ||
assertionFailure("WordPressUI.ImageCache.shared should conform to Gravatar.ImageCaching") | ||
} | ||
listenForGravatarChanges(forEmail: email) | ||
try await gravatar.setImage(avatarID: .email(email), | ||
placeholder: placeholder, | ||
rating: .x, | ||
preferredSize: preferredSize, | ||
defaultAvatarOption: .status404, | ||
options: options) | ||
} | ||
} |
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