wtsnz / coordinator-example Goto Github PK
View Code? Open in Web Editor NEWAn example of the Coordinator pattern
An example of the Coordinator pattern
Due to the default modal presentation style on iOS 13 being .sheetStyle
, the viewWillAppear()
of the underlaying SplashViewController
is not called when the NewOrderCoordinator
is dismissed and as a result the label is not updated after you've gone through the flow of creating a new order
I am basically just asking here as the blog didn't have a commenting area.
Looking around at Coordinator patterns, I struggle a bit with knowing where to place the actual business logic. In your example, at least I can see that you put it in the Coordinator itself. However this makes me wonder about a few things.
Extensions makes it nice in Swift to separate the logic, but what about Objective C, it feels like using categories would be the equivalent?
If a view controller always needs to be setup with data X from a service. That means the (as in your blog post) logic for errors and actual api calls need to be duplicated in multiple coordinator classes?
Just an observation, there will be a lot of business logic in the coordinator the more steps it have. Which is maybe annoying, I'm considering that maybe these steps would be able to be moved into a "business logic" class (maybe ViewModel type of thing). Wondering if you came across this in the final application. This also ties into the 2nd questions, with duplication.
If you have e.g. a menu and one "flow" consists of only one view controller, would it still have a specific flow class for that one? (not exactly sure about this questions but I'll add it anyway)
If you try to open the project as-is you'll run into a number of warnings as method signatures and constants have changed. If you try to run it you'll run into errors saying that Swift 3.0 is no longer supported, with no easy way to automatically upgrade to Swift 4 or 5 which are the only major versions supported by Xcode 11.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.