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

Migration to SwiftUI #493

Open
ShezHsky opened this issue Aug 28, 2022 · 2 comments
Open

Migration to SwiftUI #493

ShezHsky opened this issue Aug 28, 2022 · 2 comments
Labels
enhancement rearchitecture Improving the structure of existing code, possibly to make future work less painful technical debt Swapping a short term solution for a more maintainable one

Comments

@ShezHsky
Copy link
Member

Aim to improve the overall architecture of the app (with respect to modern Cocoa development) with the side benefit of making it easier to understand through simplification of layers.

Rather than do a full rewrite (and risk losing time for next year/introducing a slew of bugs) we should do this in stages:

  • Port existing views to use SwiftUI, each view consuming a view model dependency. Implementations of the dependency bridge into the existing model. Leave the existing routing tier as it is, with component factories returning UIHostingController objects wrapping the SwiftUI views.
  • Drop abstraction layers in model around objects and expose new NSManagedObject subclasses for entities. The model package will continue to own how we create, update and fetch them. Gradually move more behaviour into these objects (as with the current model refactor).
  • When our minimum OS dependency hits iOS 15, directly read objects into views using SectionFetchRequest and drop the view models.

All the satellite app services that use the model but do not have a visual presence in the app - e.g. notification scheduling - can continue to be driven with tests using the model. These consumers of the model can act as a sanity check for the APIs as we mov things around.

@ShezHsky ShezHsky added enhancement rearchitecture Improving the structure of existing code, possibly to make future work less painful technical debt Swapping a short term solution for a more maintainable one labels Aug 28, 2022
@ShezHsky
Copy link
Member Author

An alternative to the above is flipping the order slightly - start with introducing a new model layer and develop out the views that way (as a dual-running model using a debug setting), then bin off the old implementation following that. Most views will be pretty trivial to re-implement in SwiftUI, with the exception of News with it's compositional entity types and the login view as it involves a round trip.

@ShezHsky
Copy link
Member Author

ShezHsky commented Sep 11, 2022

Views to migrate:

  • News
  • Messages
  • Message
  • Login
  • Schedule
  • Event
  • Event Feedback
  • Dealers
  • Dealer
  • Information
  • Info Group
  • Info Detail
  • Maps
  • Map
  • Collect-them-all
  • Additional services
  • Settings/App Icon Picker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement rearchitecture Improving the structure of existing code, possibly to make future work less painful technical debt Swapping a short term solution for a more maintainable one
Projects
None yet
Development

No branches or pull requests

1 participant