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

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

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

  • @patresito
    @patresito 3 года назад +3

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

    • @iOSAcademy
      @iOSAcademy  3 года назад +2

      Thanks!

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

      Paul Hudson: "ughmmm...."

  • @Tenly2009
    @Tenly2009 3 года назад +7

    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.

  • @subinsuresh
    @subinsuresh День назад

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

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

    Great vid, I now love this pattern

  • @VijayKumar-me6qd
    @VijayKumar-me6qd 2 года назад +1

    Very nice and clear explanation 👏👏

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

    Super. I was just looking for this

  • @bruhhh9791
    @bruhhh9791 3 года назад +3

    You’re the best

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

    love it! Keep making more videos!

  • @glennadams7047
    @glennadams7047 3 года назад +1

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

  • @jakobu3159
    @jakobu3159 3 года назад +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 !

  • @devayz9305
    @devayz9305 3 года назад +1

    I love this, thanks!

  • @waheedafolabi6929
    @waheedafolabi6929 3 года назад +1

    Thanks Afraz.

  • @Денис-ж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.

  • @kalinbalabanov1013
    @kalinbalabanov1013 3 года назад +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 🤣

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

    Great video! Thanks a lot.

  • @liangyanyang2091
    @liangyanyang2091 3 года назад +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  3 года назад

      Thanks and yeah Im experimenting with different recorders

  • @Денис-ж3ф5р
    @Денис-ж3ф5р 2 года назад

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

  • @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?

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

    Impressive. Very nice.

  • @nurlanakylbekov7266
    @nurlanakylbekov7266 3 года назад

    If the project does not require Navigation Controller?

  • @dzulfikarali2579
    @dzulfikarali2579 3 года назад +1

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

  • @LinkMoody
    @LinkMoody 3 года назад

    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?

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

    how to does this work in swiftui?

  • @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.

  • @IhorFedii-n1i
    @IhorFedii-n1i 2 года назад +1

    Great!!!!

  • @smarttravel8839
    @smarttravel8839 3 года назад

    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

  • @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

  • @ekucet
    @ekucet 3 года назад +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. ;)

  • @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  2 года назад

      exactly

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

    How to pass the data from one view to another?

  • @sayedgfx
    @sayedgfx 3 года назад

    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?

  • @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

  • @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

  • @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...

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

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

  • @TheBooban
    @TheBooban 3 года назад +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 3 года назад +4

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