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

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ม.ค. 2025

ความคิดเห็น • 76

  • @bruhhh9791
    @bruhhh9791 4 ปีที่แล้ว +3

    You’re the best

  • @patresito
    @patresito 3 ปีที่แล้ว +3

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

    • @iOSAcademy
      @iOSAcademy  3 ปีที่แล้ว +2

      Thanks!

    • @mex5341
      @mex5341 3 ปีที่แล้ว

      Paul Hudson: "ughmmm...."

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

  • @sergiobost4891
    @sergiobost4891 3 ปีที่แล้ว +1

    Great vid, I now love this pattern

  • @VijayKumar-me6qd
    @VijayKumar-me6qd 2 ปีที่แล้ว +1

    Very nice and clear explanation 👏👏

  • @waheedafolabi6929
    @waheedafolabi6929 4 ปีที่แล้ว +1

    Thanks Afraz.

    • @iOSAcademy
      @iOSAcademy  4 ปีที่แล้ว +1

      Youre welcome!

  • @alibek_2001
    @alibek_2001 ปีที่แล้ว

    Super. I was just looking for this

  • @reece5863
    @reece5863 2 ปีที่แล้ว

    Impressive. Very nice.

  • @vindajojo
    @vindajojo 2 ปีที่แล้ว +1

    love it! Keep making more videos!

  • @IhorFedii-n1i
    @IhorFedii-n1i 3 ปีที่แล้ว +1

    Great!!!!

  • @sovrinfo
    @sovrinfo 2 ปีที่แล้ว

    Great video! Thanks a lot.

    • @iOSAcademy
      @iOSAcademy  2 ปีที่แล้ว

      Glad you liked it!

  • @ayo_emmanuel
    @ayo_emmanuel 3 ปีที่แล้ว +1

    I love this, thanks!

  • @glennadams7047
    @glennadams7047 3 ปีที่แล้ว +1

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

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

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

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

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

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

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

  • @dzulfikarali2579
    @dzulfikarali2579 3 ปีที่แล้ว +1

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

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

  • @Денис-ж3ф5р
    @Денис-ж3ф5р 2 ปีที่แล้ว

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

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

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

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

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

  • @subinsuresh
    @subinsuresh 2 หลายเดือนก่อน

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

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

  • @nurlanakylbekov7266
    @nurlanakylbekov7266 3 ปีที่แล้ว

    If the project does not require Navigation Controller?

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

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

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

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

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