Closed nabby26 closed 4 years ago
Thanks for the feedback everyone! Got some valuable points here. I think for now I will just merge the code. Any issues for the name changing will be addressed on future PRs.
Great work, Nabby! Thanks for the effort and time you put into this.
Context
The existing codebase in Revert is using custom protocol
Collectable
and structCollectableGroup
to decode data from the property list file into a model class that extends the protocol. This approach would require some maintenance work needed if the newer Swift version introduced and breaks the custom protocol and struct.Fortunately, Swift
Decodable
API can easily decode data from property list file into a model class, as long as the model just extendsDecodable
and no extra configuration needed.About this PR
This PR contains changes to replace
HomeItem
model class extension fromCollectable
toDecodable
. The changes apply to both Revert iOS app and tvOS app.Changes
Decodable
model and its purpose is eventually to replace existing data source class.Homeitem
are getting structure update to ensure that the file is able to be decoded toHomeItem
modelWhat's next
Decodable
DataSource
class with the new one.Collectable
and struct `CollectableGroup.