Automattic / Gravatar-SDK-iOS

Gravatar SDK is a Swift library that allows you to integrate Gravatar features into your own iOS applications.
https://gravatar.com
Mozilla Public License 2.0
36 stars 1 forks source link

Allow avatar customization #254

Closed pinarol closed 3 months ago

pinarol commented 3 months ago

Closes https://github.com/Automattic/Gravatar-SDK-iOS/issues/253

Description

Introduces AvatarType to allow 3rd parties inject their own avatar. There are 3 levels to it:

  1. Avatar is a UIImageView or a subclass of it. We apply its style normally unless they set skipStyling = true.
  2. Avatar is a UIView that has a UIImageView in it. In this case we still take care of downloading and setting the image but we don't apply any style because it's unclear where exactly to apply the style, to the parent or to the UIImageView?. It's best to let this be determined by the 3rd party component.
  3. Fully custom. Avatar is provided via "AvatarProviding" protocol.

Testing Steps

CI green.