Great insights, thanks for sharing. I'm using a similar approach, but instead of holding a reference to the coordinator I use a navigation delegate protocol for higher decoupling. This way the VC just informs the coordinator that the buy button was tapped instead of calling `buySubscription()`. So basically the VC knows only about itself and nothing else.
@ragnacode565 жыл бұрын
Every time I enjoy your tutorials! This one was awesome! Thank you!
@shriyamgupta82172 жыл бұрын
This is truly the best explanation out there for Coordinators in iOS! Thanks Paul!
@alexl25129 ай бұрын
This is a great video worth watching multiple times.
@byaruhaf5 жыл бұрын
Definitely one of the best videos on the Coordinator Pattern topic! Really enjoyed watching it! Great job, Paul & Soroush!
@alexkiddens21995 жыл бұрын
1. Child coordinators - kzbin.info/www/bejne/q5alqpVmgqeAh5Y 2. Navigating back - kzbin.info/www/bejne/q5alqpVmgqeAh5Y 3. Passing data between controllers - kzbin.info/www/bejne/q5alqpVmgqeAh5Y 4. Coordinated tab bars - kzbin.info/www/bejne/q5alqpVmgqeAh5Y 5. Using segues - kzbin.info/www/bejne/q5alqpVmgqeAh5Y 6. Protocols and closures - kzbin.info/www/bejne/q5alqpVmgqeAh5Y
@VAIBHAVMISRA19875 жыл бұрын
Thank you Paul. Every one of your video is immensely helpful and extremely practical. I definitely feel I'm a better engineer after watching your videos and trying them out in my projects.
@t16incho5 жыл бұрын
KZbin would invent a new super mega like button just for this video. Thanks Paul.
@Sin00b5 жыл бұрын
I quickly converted my project to coordinators, and it makes me very happy to split out the navigation from my controllers. My app uses a singleton for networking (I know you don’t like singletons, but I feel like for simple networking across a bunch of views, it actually makes sense, but am open to feedback), and coordinators to move between the different views, usually via button press. I can’t wait to convert over to child coordinators so i can use them in a tabviewcontroller and decouple different tabs out. It’s super clean, thanks for sharing. (BTW, I’m using server side swift for the networking as well, so thanks for teaching me vapor... its a doozy)
@rikenm5 жыл бұрын
singleton is fine if there is no state in the singleton class. Networking has no internal state usually.
@Creimbord4 жыл бұрын
Thanks for great tutorial, Paul! But I wonder what is the right way to present controller using coordinators? In video code examples you only push view controllers, what if we need to present controller modally?
@ParthoBiswas0074 жыл бұрын
I have been following your tutorial recently and I love it. FUN, Informative, and Concise.
@daniltimofeev65664 жыл бұрын
It is really fun, especially when you want modal presentation =)
@alikiran73294 жыл бұрын
So, what's the value of keeping child coordinators in an array and removing them on way back? Navigation controller (actually any parent controller) already tracking child controllers. We can access the relating child coordinator using childcontrollers anyway.
@jconstant5 жыл бұрын
Paul, these coordinator videos are fantastic. Thank you! I want to use a coordinator to manage multiple view controllers but in my case, I don't want those view controllers to fill the entire screen when shown because I have a search bar at the top of the screen that should always be displayed. Can this pattern be used to swap view controllers in/out of a Container View?
@ocannal4 жыл бұрын
Hello Paul, I think there is problem with the navigating back approach. Let's say we push another viewcontroller in BuyViewController. So didshow will be called again and from controller is BuyViewController, and it will be removed even it's not expected. It's not expected because it's not the child this time, it's parent previous viewcontroller and it's still in the viewcontroller hierarchy.
@yonataan84 жыл бұрын
Thanks for your great tutorials Paul! You're great!
@serhatt5 жыл бұрын
When I first saw coordinator I thought it's a good solution for navigation hell. But for this implementation, it adds another complexity into the code base. There are lots of closures, parent-child references going on, another problem is handling the back button. It's kinda good solution to adding removing from an array but when the project grows it won't be flexible and scalable also conforming navigation delegate also adds another complexity for every view controller transition developer should add another if statement for that. In my opinion, the coordinator pattern is not a good solution for navigation instead of solving navigation problem it adds another overhead. If I'm wrong please let me know I may have misunderstood the concept in the first place!
@rikenm5 жыл бұрын
I have seen people do a binary search instead of linear search to improve the performance. Closures are optional.
@TheScrinn2 жыл бұрын
Hi, thank you for video. I repeat everything what you did but I barely understand how to implement this by myself from scratch. What can I do to understand it better ?
@amitsamant38754 жыл бұрын
Hey paul, great explanation. I have a doubt regarding how to separate networking while using coordinator. for example the BuyViewcontroller takes the product id to buy and the product id has to be fetched from the network on basis of the selectedSegmentIndex so where should we trigger the network call inside the ViewController or Inside the coordinator?
@DimaJP4 жыл бұрын
Clear and interesting - very good material.
@harrylee39433 жыл бұрын
The best resource to learn coordinator pattern. I've watched this more than 10 times. This might be a silly question but I am not really sure why we need to keep array of child because in this video, the usage of the array is to just append when child runs and remove when child stops. Can anyone help me to understand?
@chamorro8585 жыл бұрын
Awesome job Paul, thank you for covering a lot of coordinator questions that don't seem to be answered on other coordinator tutorials!
@komunamu4 жыл бұрын
Thank you Paul for your great tutorial. When we use the coordinator with tabbarcontroller, what is the best way to add the login screen?
@abdullabardiyev2992 жыл бұрын
what does "Control the flow in your app" mean if someone knows please help me
@rajatmishra81214 жыл бұрын
Hi Paul, Great video. Thanks for sharing. Learn alot from this tutorial Could you please let me know on what basis should we create sub-coordinators in the app? I mean if we have Login Flow, Home Screen Flow then should we have 2 sub coordinators for them or is there any other factor to consider while considering sub-coordinators? Thank again
@찬-f2f Жыл бұрын
Thank you Paul 😄
@arekw60123 жыл бұрын
Great video! But how to implement a modally presented date picker? When user selects a date from presented view controller, the date must back to the caller. How to do that?
@Paul-tg8pq3 жыл бұрын
Thank you for your video! this video is very helpful to me. I have some questions. I can't understand why childCoordinator array exist. Actually, It just added and deleted a coordinator from itself. It doesn't play a role to perform related to transition and so on. When does it use? Why do you use array instead of Dictionary? If we have to use coordinators in array, this is not useful to find and access at once. please, answer my question...
@daisoreanulaurentiu39432 жыл бұрын
Hi Paul, shouldn't we also use a protocol between MainCoordinator and BuyCoordinator?
@robtea39414 жыл бұрын
Interesting, so say I wanted 2 tabs, I would make another coordinator similar to MainCoordinator and add its nav controller to the tabbar viewcontrollers array. In that case every tab had its own instance of UINavigationController. Also, say a tab just had a single view controller, I wouldn't bother with a coordinator in that case and just add it directly to the tab bar viewControllers array
@charliesoandso5 жыл бұрын
Oh, I love the tab bar integration. Great video as usual, Paul.
@TheVirusRko4 жыл бұрын
Who should handle the navigation bar behaviour? For example if we want the nav bar to be hidden in our "main" or first viewcontroller but when we move to another flow we want to show it? Should it be on every VC? or this must be handle by the coordinator again?
@davidhughes93205 жыл бұрын
How do you present view controllers? This only shows how to push and use navigation controllers. A common case might be presenting a UIAlertController.
@ahmedabdallah7415 жыл бұрын
I thought about it and I hope there is a good answer. I solved it by passing the viewController and make the present from the coordinator func buyAnAccount(_ viewcontroller: UIViewController) { let vc = BuyViewController.instantiate() vc.coordinator = self viewcontroller.present(vc , animated: false) }
@emashawn37345 жыл бұрын
Absolutely right about Segues. Although i use storyboards most of the time but i don't use segues as it tightly couples the flow.
@bscheirman5 жыл бұрын
Great job Paul! This covers most of the scenarios I've found people ask about when talking about coordinators as well.
@jeraldo45714 жыл бұрын
Should coordinators be on the ViewControllers or it should be owned by the ViewModels?
@zarzonis5 жыл бұрын
Awesome explanation on these topics Paul. From now on, I’ll use coordinators.
@aleph.58115 жыл бұрын
so in the child coordinator section, who is responsible for calling buySubscription()? Also, in the BuyViewController, how is it possible to instantiate the navigation stack which needs to reference to what the UIWindow is referencing?
@WilliamGattoFilho2 жыл бұрын
3:16
@goatfacethrilla93674 жыл бұрын
Should each coordinator only push a single view to the navigation stack? If another view is required should the coordinator start a coordinator for THAT new view instead?
@jakyducati5 жыл бұрын
closures fit just great here
@burakakyalcin5 жыл бұрын
yeah but i don't like them taking too much space
@akshitzaveri2244 жыл бұрын
When you have many actions, closures degrades the readability and maintanability.
@estiqueahmedrashel22794 жыл бұрын
How to handle back when we want to go to a different ViewController from BuyViewController?
@bdaralan5 жыл бұрын
Thank you for a great explanation. Will implement this in my current senior project app.
@xfabiosoft4 жыл бұрын
Some video/tutorials about ReSwift and redux on ios?
@jevoncharles6065 жыл бұрын
Great video. You have the ability to take something that can be complicated but make it seem simple. I notice that coordinators are a big topic in the community right now. I do like the upsides to them. Do you ever fear there is too many ways that are considered good coding but all do the same thing?
@deborabarbosa96464 жыл бұрын
Is there a way of nagating back with only the mainCoordinator and those 3 viewControllers? (without childCoordinators)
@SteveHiemstraAKAspeg4 жыл бұрын
So glad I only know SwiftUI.
@rgenericson53614 жыл бұрын
Then you're seriously missing the boat bro! ; -)
@kohjiarong64525 жыл бұрын
Hi Paul, thanks for providing explanations. It would be great if you could also explain how can we use coordinators to handle different size variants, ie iPad and iPhone variants. Thanks!
@gabrielsscavalcante5 жыл бұрын
Thank you again! Great video! I was waiting for this one :)
@pierogfgenoveseII5 жыл бұрын
Great video!
@oguzparlak78575 жыл бұрын
Great Job Paul ! It helped me a lot.
@abanoubghaly76852 жыл бұрын
Can anyone tell me the benefits of using an array of child coordinators because I just append and remove them without using their references in the navigation process itself Anyone could help?
@leftboot135 жыл бұрын
I programmatically create my app and use child viewcontrolers. If I understand correctly, I don’t need to worry about implementing “storyboarded”. Is that right? How would you go about configuring a cordinator for this? Create a main coordinator and let all the child view controller‘s talk to that coordinator? Then pass the data as shown? Thanks for the great info once again.
@gnut10105 жыл бұрын
How to handle coordinator if I present ViewController instead of push it
@maximkrouk16975 жыл бұрын
Love the content you do ❤️, definitely gonna buy a few books soon c:
@salmansiddiqui2995 жыл бұрын
How to pass data from one coordinator to another?? As we are using common coordinator protocol to start
@felipefgarcia89695 жыл бұрын
Why not have a sample project so we can download and see the implementation, there's no link to github or something like?
@nickkarpov14 жыл бұрын
Awesome!
@shadealix2 жыл бұрын
Making any coordinator to be UINavigationViewControllerDelegate has huge cons. Any coordinator which has reference to navigationController can re-assign delegation to itself at any time. And it's brake the logic
@frantisaulhuamanmera31265 жыл бұрын
thanks for sharing Paul.
@xVinoz Жыл бұрын
If you are using storyboards stop and start programatic uikit, thats the industry standard, peace.
@xVinoz Жыл бұрын
ahhh the excessive zoom in the screen is driving me crazy
@EEGAMINGYT19945 жыл бұрын
I am first person to view this video thanks for the video