diff --git a/Sources/WordPressUI/Extensions/Gravatar/Gravatar.swift b/Sources/WordPressUI/Extensions/Gravatar/Gravatar.swift index 3b8525a..e4fdcf6 100644 --- a/Sources/WordPressUI/Extensions/Gravatar/Gravatar.swift +++ b/Sources/WordPressUI/Extensions/Gravatar/Gravatar.swift @@ -3,6 +3,7 @@ import Foundation /// Helper Enum that specifies all of the available Gravatar Image Ratings /// TODO: Convert into a pure Swift String Enum. It's done this way to maintain ObjC Compatibility /// +@available(*, deprecated, message: "Use `Rating` from the Gravatar iOS SDK. See: https://github.com/Automattic/Gravatar-SDK-iOS.") @objc public enum GravatarRatings: Int { case g @@ -30,12 +31,14 @@ public enum GravatarRatings: Int { /// Helper Enum that specifies some of the options for default images /// To see all available options, visit : https://en.gravatar.com/site/implement/images/ /// +@available(*, deprecated, message: "Use `DefaultAvatarOption` from the Gravatar iOS SDK. See: https://github.com/Automattic/Gravatar-SDK-iOS.") public enum GravatarDefaultImage: String { case fileNotFound = "404" case mp case identicon } +@available(*, deprecated, message: "Use `AvatarURL` from the Gravatar iOS SDK. See: https://github.com/Automattic/Gravatar-SDK-iOS") public struct Gravatar { fileprivate struct Defaults { static let scheme = "https" diff --git a/Sources/WordPressUI/Extensions/UIImageView+Gravatar.swift b/Sources/WordPressUI/Extensions/UIImageView+Gravatar.swift index 89dbd06..f85890f 100644 --- a/Sources/WordPressUI/Extensions/UIImageView+Gravatar.swift +++ b/Sources/WordPressUI/Extensions/UIImageView+Gravatar.swift @@ -29,6 +29,7 @@ extension UIImageView { /// - email: the user's email /// - rating: expected image rating /// + /// This method uses deprecated types. Check out the UIImageView extension from the Gravatar iOS SDK as an alternative to download images. See: https://github.com/Automattic/Gravatar-SDK-iOS. @objc public func downloadGravatarWithEmail(_ email: String, rating: GravatarRatings) { downloadGravatarWithEmail(email, rating: rating, placeholderImage: .gravatarPlaceholderImage) @@ -41,6 +42,7 @@ extension UIImageView { /// - rating: expected image rating /// - placeholderImage: Image to be used as Placeholder /// + /// This method uses deprecated types. Check out the UIImageView extension from the Gravatar iOS SDK as an alternative to download images. See: https://github.com/Automattic/Gravatar-SDK-iOS. @objc public func downloadGravatarWithEmail(_ email: String, rating: GravatarRatings = .default, placeholderImage: UIImage = .gravatarPlaceholderImage) { let gravatarURL = Gravatar.gravatarUrl(for: email, size: gravatarDefaultSize(), rating: rating) @@ -88,6 +90,7 @@ extension UIImageView { /// - animate: enable/disable fade in animation /// - failure: Callback block to be invoked when an error occurs while fetching the Gravatar image /// + /// This method uses deprecated types. Check out the UIImageView extension from the Gravatar iOS SDK as an alternative to download images. See: https://github.com/Automattic/Gravatar-SDK-iOS. public func downloadGravatar(_ gravatar: Gravatar?, placeholder: UIImage, animate: Bool, failure: ((Error?) -> Void)? = nil) { guard let gravatar = gravatar else { self.image = placeholder