|
I've send the following to pauls email. After I found this forum :/ Guess sometimes you cant see the tree in the forest. I try to learn more about navigation and your articles of the coordinators are great. Though I can’t make it work. You can have a look at the project at https://github.com/GlennDrescher/Disputea When I create a new Xcode Project I also have Scene Delegate. Maybe that has something to do with it? When I finish the first video about Coordinators I end up with the 2 buttons which do nothing and no navigation bar at the top. Could you tell me why the buttons are not changing the View? Another question: What if I want to use Coordinations with optional Navigation controller. For example in the case of Login screen you likely don’t want a back button. Another thing: Instead of:
I would love to have something less “smelly” like:
<- this could be a cool way to navigate anywhere and choose if you want to push it to the navigation controller or not. But maybe the navigation aspect could better be per Coordinator, like “this section / coordinator has navigation the other don’t" Any idea why this is not working? I tried with Storyboarded which would be more specific, but then it complaints something about self and it doesn’t work either. So basically 3 questions:
|
|
Hi Glenn, The code you used in the App Delegate should actually go on the Scene Delegate. Paul's video is prior to the change Apple made to introduce scene delegates, that's why his code his in the app delegate. As for the Login screen, it won't have a "Back" button if it is the first screen the controller presents, so, no change there, I suppose. As for the "smelly" code fix, it turns out the new code smells more. The first reason is because it increases coupling, since one View Controller has to know the next VC(s). The second is because the goal of the Coordinator is to control (coordinate) the navigation, when a VC knows what the next screen is, it is taking part of that responsibility to itself (which brings us back to the first reason). So, all the VC needs to tell the controller is "I finished my job, here's what I've got in case the next screen needs my data", the coordinator will know what the next screen is and will provide the data, if needed, or even process that data received before passing it on. I hope that helps. |
|
@GlennDrescher - Had this same problem. Here's my solution. @guseulalio - Thanks for the HUGE clue, which lead me to this source. Put AppDelegate back the way it was. Add
|
SPONSORED Take the pain out of configuring and testing your paywalls. RevenueCat's Paywalls allow you to remotely configure your entire paywall view without any code changes or app updates.
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.