Swift Coordinator Design Pattern (iOS, Xcode 12, 2022) - iOS Design Patterns

Поділитися
Вставка
  • Опубліковано 26 гру 2024

КОМЕНТАРІ • 76

  • @Tenly2009
    @Tenly2009 3 роки тому +8

    Would have been good to see how the co-ordinator passes model data to/from the VC’s.

    • @chrismyers5571
      @chrismyers5571 3 роки тому

      I've personally used the delegate pattern to pass objects around between View Controllers via a coordinator.

  • @patresito
    @patresito 3 роки тому +3

    Finally a good tutorial that is nicely explained and up to date, kudos.

  • @VijayKumar-me6qd
    @VijayKumar-me6qd 2 роки тому +1

    Very nice and clear explanation 👏👏

  • @sergiobost4891
    @sergiobost4891 3 роки тому +1

    Great vid, I now love this pattern

  • @alibek_2001
    @alibek_2001 Рік тому

    Super. I was just looking for this

  • @Денис-ж3ф5р
    @Денис-ж3ф5р 2 роки тому +1

    Why did you write the same code in both scene delegate and app delegate. I thought the scene delegate along would be enough.

  • @ViktorMameshyn
    @ViktorMameshyn Рік тому

    Hey, thanks for the great content! One question - I see that navigation pushes are handled. What if I need to present VC modally - how to handle it better using Coordinator pattern?

  • @bruhhh9791
    @bruhhh9791 4 роки тому +3

    You’re the best

  • @myrondulay8628
    @myrondulay8628 3 роки тому +2

    I noticed that you define var coordinator: Coordinator?
    some tutorials I've seen that they use weak var coordinator: Coordinator?
    doesn't yours retain cycle? I tried adding weak but I think the reference was broken and the navigation was not working anymore.

  • @vindajojo
    @vindajojo 2 роки тому +1

    love it! Keep making more videos!

  • @Денис-ж3ф5р
    @Денис-ж3ф5р 2 роки тому

    Coordinating controllers must have a property by the name of coordinator as a weak reference, mustn't they?

  • @kalinbalabanov1013
    @kalinbalabanov1013 4 роки тому +1

    I haven’t watched the whole video just yet, disclaimer in case you mention it, but a quick note when you import UIKit it automatically imports foundation so importing foundation is redundant

    • @tokero5199
      @tokero5199 2 роки тому

      Why is this comment on so many swift related videos? Sure it's true, but it also does not really matter, it's not like foundation is imported twice or there is any overhead also it's not the focus of the video.

    • @kalinbalabanov1013
      @kalinbalabanov1013 2 роки тому +1

      @@tokero5199 I don’t know man, it was one of my pet peeves 🤣

  • @LinkMoody
    @LinkMoody 4 роки тому

    How it is better than just to define a static function show(from: UIViewController)?
    Also does it mean that you have to apply this coordinator pattern to all of your controllers in project?

  • @dzulfikarali2579
    @dzulfikarali2579 3 роки тому +1

    Great video mate, would u mind do the mvvm-c as well?

  • @sovrinfo
    @sovrinfo 2 роки тому

    Great video! Thanks a lot.

  • @liangyanyang2091
    @liangyanyang2091 4 роки тому +2

    Just great! Thank you for your hard work. Somehow the quality of the video got worse, I mean the resolution got not that sharp as before, I thing when exporting from the video the resolution should be changed

    • @iOSAcademy
      @iOSAcademy  4 роки тому

      Thanks and yeah Im experimenting with different recorders

  • @glennadams7047
    @glennadams7047 3 роки тому +1

    Great intro! I would like to see more on this. Thanks!

  • @ekucet
    @ekucet 4 роки тому +2

    can i imlement to swiftui peoject this pattern? Would it be correct to use it with SwiftUI?

    • @dewigesrek5651
      @dewigesrek5651 3 роки тому

      i personaly dont see the ise of this pattern in swiftUI, it’ll complicate things

    • @dewigesrek5651
      @dewigesrek5651 3 роки тому +1

      but hey, who am i to judgr

    • @ekucet
      @ekucet 3 роки тому

      ​@@dewigesrek5651 Thank you for your response. I think like you for Coordinator pattern with SwiftUI. Finally, your thoughts are valuable. ;)

  • @ayo_emmanuel
    @ayo_emmanuel 3 роки тому +1

    I love this, thanks!

  • @smarttravel8839
    @smarttravel8839 4 роки тому

    hi can you do a video on programmatically create control like textField, textView ,imageview base on json file. This mean json contain the info on what control to create and add all control into a form which can be scroll. Thanks

  • @waheedafolabi6929
    @waheedafolabi6929 4 роки тому +1

    Thanks Afraz.

  • @jakobu3159
    @jakobu3159 4 роки тому +8

    Hey! Could you talk about algorithm and how you implement it into a swift project in Xcode? Don’t talk about the fundamentals, just how to implement it please !

  • @reece5863
    @reece5863 2 роки тому

    Impressive. Very nice.

  • @nurlanakylbekov7266
    @nurlanakylbekov7266 3 роки тому

    If the project does not require Navigation Controller?

  • @jakubgawecki4264
    @jakubgawecki4264 3 роки тому +1

    Hey man, thanks for the video. How would you implement case Event when you do need to pass some parameter in order to initialise our VC?

    • @anhduong4652
      @anhduong4652 3 роки тому

      I think you can pass data along with enum parameter. Ex: orderButtonTapped(_ data: String)

    • @iOSAcademy
      @iOSAcademy  3 роки тому

      exactly

  • @kaloyako1
    @kaloyako1 9 місяців тому

    how to does this work in swiftui?

  • @glennposadas8091
    @glennposadas8091 3 роки тому

    Hi. Thanks for this! Do you have a public repo for this particular project?

    • @iOSAcademy
      @iOSAcademy  3 роки тому

      All code is available for channel members. Its how I keep the content going

  • @IhorFedii-n1i
    @IhorFedii-n1i 3 роки тому +1

    Great!!!!

  • @subinsuresh
    @subinsuresh 2 місяці тому

    How to pass data from second view controller to first view controller using coordinator pattern?

  • @sayedgfx
    @sayedgfx 4 роки тому

    Hey Afraz, I currently have an issue with Xcode where it crashes when I run any of my projects on a phone. Looked it up and tried every solution but nothing seems to fix that, have you encountered this before?

  • @hackchild7199
    @hackchild7199 3 роки тому +1

    #retainCycle - use weak var in your controllers.

    • @iOSAcademy
      @iOSAcademy  3 роки тому

      Correct

    • @casadogaspar
      @casadogaspar 2 роки тому

      When I use weak in this code from the video, it doesn't navigate to other views.
      Theres any other configuration that must be done together that am I missing?

  • @JohnD9271
    @JohnD9271 3 роки тому

    How to pass the data from one view to another?

  • @myrondulay8628
    @myrondulay8628 3 роки тому

    Great Course! Thanks a lot.
    Can you show us a tutorial also how to pass data between controllers using a coordinator?
    btw I think your audio is too low compared to most of youtube videos out there. Every time I opened your vids your audio for your voice is low.
    Might want to check that out. Thanks again!

    • @iOSAcademy
      @iOSAcademy  3 роки тому

      Thanks, yep newer videos have raised volume

    • @Денис-ж3ф5р
      @Денис-ж3ф5р 2 роки тому

      Just send data with the enum in coordinator as associated type, there is not too much to it

    • @Денис-ж3ф5р
      @Денис-ж3ф5р 2 роки тому

      read comments there is the exact same answer I've just given

  • @kirillpukhov2004
    @kirillpukhov2004 2 роки тому

    Why do you always removing Storyboards?

    • @casadogaspar
      @casadogaspar 2 роки тому +1

      Because he's doing the UI programmatically (using code).

    • @tokero5199
      @tokero5199 2 роки тому

      Because they suck...

  • @joker_in_the_pack
    @joker_in_the_pack 3 роки тому +1

    you could do:
    let vc = SecondViewController()
    vc.coordinator = self
    instead of:
    var vc: UIViewController & Coordinating = SecondViewController()
    vc.coordinator = self

  • @1stplace362
    @1stplace362 2 роки тому

    14:00

  • @kyzmitch2
    @kyzmitch2 2 роки тому

    Coordinating should be AnyObject, you don't need to make it var

  • @TheBooban
    @TheBooban 4 роки тому +2

    Oh no. Not another pattern. And it's 21 mins too....! What about KVO pattern? Everywhere it says I should know KVO pattern for interviews and at the same time they say nobody uses it.

    • @BradleyWeston92
      @BradleyWeston92 4 роки тому +4

      The coordinator pattern is used a lot in real world projects for apps and apis, it is a good one to learn.