How to implement the Coordinator pattern in Swift!

Поделиться
HTML-код
  • Опубликовано: 13 окт 2024

Комментарии • 30

  • @v_pradeilles
    @v_pradeilles  2 года назад +6

    Did you find this explanation useful? Are you planning on using the Coordinator pattern in your apps? Let me know in the comments 🚀

    • @problem.solver
      @problem.solver 2 года назад

      Any reason for calling it coordinator not a router?

    • @v_pradeilles
      @v_pradeilles  2 года назад +1

      @@problem.solver it got its name mostly thanks to this blog article: khanlou.com/2015/01/the-coordinator/
      But indeed you’re right that the idea here is very similar to a router!

    • @problem.solver
      @problem.solver 2 года назад

      Amazing. Thanks.

  • @PacificAtitude
    @PacificAtitude 2 года назад +5

    Thanks for the thorough explanation, purhaps a futur video making use of childCoordinator array ? It would be intersting to see how coordinators interact with each other.

  • @draganmarkovic7221
    @draganmarkovic7221 2 года назад +1

    Once again you covered great topic in a great way.
    Keep up the good work! 💪

  • @aguzman11189
    @aguzman11189 2 года назад +1

    Wow this video came at a great time! I just learned about the Coordinator pattern yesterday from a video Paul Hudson had made :)

  • @illyakrit7494
    @illyakrit7494 7 месяцев назад

    Thank you for explanation! Honestly, I don't see any reason to add navigationController to the Coordinator protocol. So, on my opinion, it can be under the hood in the MainCoordinator class. Consumer of the Coordinator protocol don't need to know how the navigation happens and don't need any access to the navigationController

  • @fernandomarins1596
    @fernandomarins1596 2 года назад +1

    What an excellent explanation, super easy to understand and really helpful! Thank you!

    • @v_pradeilles
      @v_pradeilles  2 года назад

      Thank you, glad to hear you enjoyed the video ☺️

  • @sk4tec
    @sk4tec Год назад

    Hey Vincent, I saw you at SwiftLeeds and I've started watching your videos. I like them because they are small and bite sized. Keep up the good work!

    • @v_pradeilles
      @v_pradeilles  Год назад

      Awesome to hear that the QR code to the YT channel at the end of my slides was useful 😀

  • @sami790311
    @sami790311 Год назад

    The Coordinator pattern is an okay solution but still tightly couples the viewcontroller with the presentation.
    For instance, show detail is coupled with always presenting it with push navigation. What if I want to present it modally, with certain animations that could be
    different for each screen.
    I think Composition is a better way to approach the navigation problem. Each case can decide how to present the next screen and still not coupled.

  • @ganeshpawartrekker
    @ganeshpawartrekker 2 года назад

    Thanks for this video. I learnt a new thing today. I have one query that what if our project gets bigger? Isn’t coordinator too going to be too big?

  • @narjesabbaspour4695
    @narjesabbaspour4695 2 года назад

    Thank you very much , please add coordinator child and routers too , cuz I found it challenging and has memory leaks some times

  • @roman3249
    @roman3249 2 года назад

    Hi Vincent. I'm a big fan of CleanSwift architecture. Can the Coordinator pattern be applied along with CleanSwift? Or does the Router of CleanSwift play role of the Coordinator?

  • @indiekiduk
    @indiekiduk 2 года назад

    check out the responder chain, it's a built in coordinator!

  • @sk4tec
    @sk4tec Год назад

    Vincent, how can this be (easily) be done in SwiftUI - would love this as a video!

    • @v_pradeilles
      @v_pradeilles  Год назад

      Great suggestion! The topic is a bit long for a video, however I could do livestream on it in the future 👀

  • @nameless6990
    @nameless6990 2 года назад

    Thanks for video awesome 🙏
    can we also inject coordinator to movies vc on init method and set it as nil in deinit?
    what do you think about this approach😕
    Also, what if we had a one more page/vc should we have defined a different coordinator for it?

    • @xVinoz
      @xVinoz Год назад

      Everything. can be done if you want but in this case you cant cause you are coupling the viewModel to a Navigation Module so theres no relation

  • @alexl2512
    @alexl2512 7 месяцев назад

    Hi Vincent. Can you share the code so I can play with it?

    • @v_pradeilles
      @v_pradeilles  7 месяцев назад

      You have the link in the description: gist.github.com/vincent-pradeilles/6ab3720827698712c138059542b0f2ba

  • @ivan180593
    @ivan180593 2 года назад

    Could be a good idea to assign the coordinator variable in the view model instead of the view controller?
    Maybe you can avoid retain cycles if you miss 'weak'

    • @xVinoz
      @xVinoz Год назад

      No cause you are coupling the viewModel to a Navigation Module so theres no relation

  • @4_lyrics
    @4_lyrics 2 года назад

    The promo code does not work ? I must be doing something not right

    • @v_pradeilles
      @v_pradeilles  2 года назад +1

      So sorry for this. I’ve let the people at Realm know about the issue, hopefully it should be fixed soon 🙌

    • @v_pradeilles
      @v_pradeilles  2 года назад

      Can you send me a DM on Twitter? (twitter.com/v_pradeilles)

  • @GabrielBrodersen
    @GabrielBrodersen 2 года назад

    Will you creative a SwiftUI version?

    • @v_pradeilles
      @v_pradeilles  2 года назад +1

      I'm taking good note of your suggestion! On SwiftUI the pattern requires a bit more work, so maybe a livestream would be a better format!