Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert all model objects to Decodable and get rid of legacy codes #62

Merged
merged 17 commits into from
Aug 25, 2020

Conversation

nabby26
Copy link
Contributor

@nabby26 nabby26 commented Aug 24, 2020

About

This is the continuation of PR #59.

In this PR, the legacy DataSource class is replaced with the new one and all view controllers are updated to be compatible to use the new DataSource implementation.

Therefore, all model objects needed to be converted to extend Decodable.

Other than that, all irrelevant and unused legacy codes are being removed from the project.

Changes

  • DataSource replacement.
  • Removal of legacy code: Collectable, CollectableGroup, CollectableCollection, and Requirement.
  • Conversions of all model objects to extend Decodable.
  • Removal of legacy data fetching property in RevertItems.
  • ItemSection addition to handle data in ControlsViewController and AlertViewController.
  • MapLocation addition to represent each annotation from MapLocations.plist.
  • Simplify MapAnnotationView initiation and get rid of the legacy data fetching configuration.

Converting `Country` model to extend Decodable protocol only.

These changes only work on tvOS app only.
This new data fetching method is compatible with existing `Country` struct that only extends decodable.
Due to the usage of `Decodable`  and `RevertSection` protocol on model objects, these 3 legacy protocol/strcuts are no longer needed:
- `Collectable` protocol
- `CollectableCollection` struct
- `CollectableGroup` struct
Datasource class has been replaced.
Getting rid legacy data fetching and make use  `MapLocationItem` that extends decodable.
@nabby26 nabby26 self-assigned this Aug 24, 2020
Copy link
Member

@tonyarnold tonyarnold left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactoring is the sweetest of all development.

Nice work - when you've finished tidying up the stylistic items we discussed on slack (explicit self and fileprivate use), feel free to merge this work.

Shared/Sources/RevertItems.swift Outdated Show resolved Hide resolved
Copy link
Contributor

@DechengMa DechengMa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice work

Shared/Sources/DataSource.swift Outdated Show resolved Hide resolved
Shared/Sources/RevertItems.swift Outdated Show resolved Hide resolved
Shared/Sources/DataSource.swift Show resolved Hide resolved
@nabby26 nabby26 merged commit 0af526d into master Aug 25, 2020
@nabby26 nabby26 deleted the convert-item-model-to-codable branch August 25, 2020 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants