Closed etoledom closed 1 month ago
App Name | Gravatar SwiftUI Prototype Build | |
Build Number | 1079 | |
Version | 1.0 | |
Bundle ID | com.automattic.gravatar-sdk-demo-swiftui.prototype-build | |
Commit | 62f22104ac71b0d00fd64cb936a03541743f7d42 | |
App Center Build | Gravatar SDK Demo - SwiftUI #27 |
App Name | Gravatar UIKit Prototype Build | |
Build Number | 1079 | |
Version | 1.0 | |
Bundle ID | com.automattic.gravatar-sdk-demo-uikit.prototype-build | |
Commit | 62f22104ac71b0d00fd64cb936a03541743f7d42 | |
App Center Build | Gravatar SDK Demo - UIKit #28 |
Closes #
Description
This PR tries to simplify the logic on AvatarPickerView and AvatarPickerViewModel.
I don't think this is a big simplification, but there's one big conceptual change which I like:
The avatar grid itself is now completely independent of the AvatarPickerView, with its own model which managed the status of the grid as a whole and of individual avatar cells, including avatar loading, selection, and (in the future) error state.
Avatar Grid model and view are independent of any networking (expect of image loading). All requests are managed by the
AvatarPickerViewModel
, and updates the grid accordingly.AvatarPickerViewModel
holds a reference to the GridModel and updates it as needed, whileAvatarPickerView
will pass the grid model reference to the grid view.In this way
AvatarPickerViewModel
is not responsible for holding the list of avatars, which avatar is selected, or individual avatar cell status, but it still holds the responses from networking.Testing Steps