iOS MVVM swift code review best practices | Hindi

Поделиться
HTML-код
  • Опубликовано: 1 авг 2024
  • MVVM (model view view model) is an architecture pattern that's catching up in the iOS domain and hence it's important to know how to write clean code with iOS.
    We had a small event on the iOS cafe discord server to review a sample code using MVVM pattern and discuss what are the best practices to follow using MVVM pattern in Swift.
    Hope this video helps to write clean and stable code.
    Given are the chapters for the video
    0:00 reviewing constant file
    0:50 reviewing validation layer
    4:42 avoid writing negative logic
    5:44 reviewing the HttpUtility
    13:03 reviewing the model layer
    15:40 reviewing employee resource
    17:02 reviewing test cases
    17:40 reviewing login resource
    19:03 reviewing login view model
    22:11 dependency inversion
    23:55 swift lint
    24:46 reviewing the view controller
    27:10 conclusion
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ✅ Subscribe to the channel and stay ahead of everyone by following the right way for writing clean code in swift. 🔥🔥🔥🔥🔥
    🔗Click on the link to subscribe: ruclips.net/user/codecat?sub...
    iOS Cafe discord server invitation link: / discord
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    -----------------------------------------------------------------------------------------------------------------------
    ############################################
    Connect with me on social media
    Instagram: codecat15
    📧: codecat15@gmail.com
    🐦: / codecat15
    Facebook: / code.cat.792
    Github: github.com/codecat15
    ###########################################
    #swiftmvvm #MVVM #modelViewViewModel

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

  • @pushkerpandey9312
    @pushkerpandey9312 2 года назад +4

    This video is really helpful in understanding the mvvm and code writing styles

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

      Glad it was helpful 😊

  • @VishnuMp112
    @VishnuMp112 2 года назад +4

    Following your channel after a simple search of multithreading in swift and watched almost every videos now.
    Learning both Hindi and Swift :)

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

      Thank you Vishnu, I try to add English captions on few of my videos but then adding captions is really time consuming but still if you get stuck don’t hesitate to ask questions I’ll be happy to answer it for you.

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

      @@CodeCat15 No problems . I got a lots of my doubts cleared from your old videos even without captions 🙂🙂

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

      That’s great

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

    Great review

  • @pushkerpandey9312
    @pushkerpandey9312 2 года назад +2

    Hum first, hum first

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

    This is very informative video
    Though I am not iOS Developer, I like to watch your videos...
    Wonderful

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

      Thanks Shubham, means a lot 😊

  • @azadbaljeet
    @azadbaljeet 9 месяцев назад

    Great, and very helpful, Ravi, where is source code of it?

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

    Why not using weak self in closures? Can you please explain

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

    I wish you a vert Happy Birthday ravi sir

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

      Thank you Akshay 😊

  • @RedPPP
    @RedPPP Год назад +1

    This is valuable content, and I wish it could be in English.

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

      Thank you for your suggestion. I appreciate your interest in English content. As my current audience prefers Hindi, I'll continue creating content in Hindi to cater to their needs. However, I'll consider adding English subtitles in the future to reach a wider audience. Thank you for your support!

  • @mandeepsinghbaath6892
    @mandeepsinghbaath6892 2 года назад +2

    Ravi you are very helpful person and also shared expensive industry experience free of cost , I need your suggestion on this -> I want to prepare DSA and system design for amazon interview can you guide me from where I need to start ,

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

      Get the book how to crack coding interview it’s a decent book that should help you out, although it’s not guaranteed that whatever question you read online or solve that’s the one that Amazon will ask but the book and sites like leetcode are a big help in preparations to give you that head start

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

      @@CodeCat15 big thanks Ravi sir

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

    Hahaha har jagah code 200
    the clarification they give is code 200 is request went through abi tum status check karo true aur false ka.
    Yes faila huwa business hai bhau,
    Bro already 10k subs. Soon we will celebrate 100k

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

      faila hua business to hai creative developers ka, but If I can become a responsible developer from being a creative one I am sure they too can. Thank you Sanjay

  • @AnkitSingh-ds9py
    @AnkitSingh-ds9py 2 года назад +1

    discord server link is not working

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

      I verified the link and it takes me to the accept invite page, you have to accept the invite and then it’ll take you to login/signup screen.
      Once that happens you would then need to verify yourself by adding a captch in verify-here channel and then you would have the access.
      May I know what you are seeing when you click the link?

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

    make a vedio on api with almofire

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

      for simply parsing API I advice not using a third party tool as it adds no value to the project, is there a different use case you have in mind for using alamofire?

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

      @@CodeCat15i want to use for api integration i am at beginer level,kindly make a vedio in detail

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

      If it’s simple API parsing then I suggest looking at the API playlist which uses URLSession as that has been the industry standard, many devs are moving away from alamofire or any third party library to do API parsing or even SSL pinning and they use URLSession.
      If you are a fresher then I strongly advice against using alamofire and perform parsing using URLSession

  • @nagarajvrao7249
    @nagarajvrao7249 Месяц назад +1

    19:30 - A reference cycle only occurs if both types involved are reference types, not if one is a value type. Therefore, conforming to AnyObject is unnecessary when one side is a struct.
    The reason a ViewModel (VM) should be a class rather than a struct is due to state management. When a property of a struct is changed, the entire struct is recreated with the new value, causing the rest of the state to be lost. This means we would need to retain the shared instance every time the value of the struct-based VM is changed, which is not practical.
    Please correct me if I'm wrong, @codecat15 @ravi.

    • @CodeCat15
      @CodeCat15  Месяц назад

      right, but then as I explained in the video that mostly devs prefer class over struct and the explanation was given to ensure that if the view-model (VM) is a class then ensure the AnyObject conformation and the implementation of weak.
      A VM should never hold state whatsoever it is an orchestration class and not a class that manages state of the objects.