Introduction to Swift: Initializers (init method) part 1

Поділитися
Вставка
  • Опубліковано 19 тра 2019
  • In this session, I have tried to explain what are init methods and how to use them. Also, an intro to failable init for swift 5.
    Let me know your comments on this video and any feedback if you have for me to improve or email me at codecat15@gmail.com
    Connect with me on social media
    Email: codecat15@gmail.com
    Twitter: / codecat15
    Facebook: / code.cat.792
    Github: github.com/codecat15
    Instagram: / codecat15

КОМЕНТАРІ • 72

  • @madmaxcoder6209
    @madmaxcoder6209 4 роки тому +6

    Been a swift developer for 2 years and didn't knew that init can do so much, as expected a wonderful video once again for all the swift beginners which covers swift init method in depth and what's amazing is you created two videos speaking about the init method and the depth of knowledge i gained by just watching those video is amazing. Thank you for sharing this

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

      Thanks once again for such comments, do share this channel with anyone you know who is trying to learn swift and become an iOS developer 😊 Have a great day ahead

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

    Much better than any paid course. Simple and Easy to understand. Thank you so much!!!!

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

    This is very helpful video for beginners as well as experienced developers. Very well explained.

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

      Thank you Shailendra and welcome to the channel.

  • @vilas18able
    @vilas18able 12 днів тому

    Great explanation Ravi. Kudos these concepts will help anyone who wants to brush up on the basics at any point in their career. I hope you make more videos on the latest concepts of swift.

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

    I have been watching videos on classes, structures, and init to understand their relationship and develop a mental framework by drawing a comparison, and THIS video has been the only one by far which has helped me to do so. I don't know if it was the fact that it was being dictated in Hindi that subconsciously helped me or maybe the teaching style, but please continue this. So many tutorials explain WHAT IT IS, but never explain how it relates to other things. THank you

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

      Hey Harsh welcome to the channel and thank you for your kind words, am glad that this video was helpful to you and if you have few questions on this or any topic then please do feel free to ask i will be happy to answer them

  • @kalashchoudhary4713
    @kalashchoudhary4713 Рік тому +1

    I dont have words to express my happines after getting clearer in my doubts after watching your Videos thankyou!

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

      I am glad this video was helpful Kalash, and thank you for your kind words

  • @vaibhavigokhale
    @vaibhavigokhale 8 місяців тому +1

    Failable init explained very well

    • @CodeCat15
      @CodeCat15  8 місяців тому

      Glad it was helpful

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

    Extremely like your videos. finally after 2 years, I found your channel who explained very well in Hindi. Thank you so much bro

  • @venusbhatia
    @venusbhatia 7 місяців тому +1

    Ravi Bhai doing god's work, thanks!

    • @CodeCat15
      @CodeCat15  7 місяців тому

      Thank you for your kind words, I hope this channel is helpful in your iOS journey. Please feel free to ask questions and do share the channel with your iOS group.

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

    Always one the best tutorials on swift. I have been watching your swift basics series and exploring even more new things in swift. Such a good content 🙂

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

      Glad to hear that the content is helpful Neeraj, please feel free to share this video with your friends and do ask question on this topic

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

    Hi Ravi...This is again fantastic tutorial..I don't have words to appreciate but in simple words...great work..Keep it up and keep teaching us. Thank u so much..... for ur efforts for us. Thanks

  • @PawanKumar-Ravish
    @PawanKumar-Ravish 2 роки тому +1

    thanks bhai for making the vedio ....ye vedio na hoti to me shayad smjh na pata how to init...thanks bhai again

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

      doubts ho to puchna is topic pe, beginners series ki playlist mai kaafi videos hai jo aapko help karega swift ko aache se explore karne mai

    • @PawanKumar-Ravish
      @PawanKumar-Ravish 2 роки тому

      @@CodeCat15 bilkul bhai krta hu aapko mail

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

    Thanks for sharing Failable init, helpful.

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

      It’s not used much but then you may need it in some special use cases good to know this actually specially from an interview standpoint

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

      @@CodeCat15 I guess you have replied to wrong comment, or its a youtube bug. I've posted comment on other videos where I mentioned the question is asked in the interview. Well, thanks for taking time to reply.

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

    Hey CodeCat, I am preparing for interviews and your every video added value in development and learning point of view, Superb teaching skills and your depth of knowledge is simply awesome.
    Thanks for basics with simple explanation.

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

      Thank you Tushar for your kind words, I am sure you will knock down all the interviews and will share the selection news soon. All the best

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

    Good one for iOS development Head start.

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

      Glad it was helpful :)

  • @TheMihirpatel23
    @TheMihirpatel23 Рік тому +1

    thanks for this video...very straight explanation

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

    Hi Ravi, You have good knowledge in swift and your teaching style is also an excellent thanks, for valuable content

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

      I am glad that this video was helpful to you and you found it useful, once again thank you for your kind words, and always feel free to ask questions on this or any topic will be happy to answer them. And do share this with your iOS group too

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

      @@CodeCat15 yes I will share with IOS groups thanks, one question
      will you make a dedicated video on how to get an IOS developer job in the US or in big companies in India

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

      I can share how i ended up in the US, but to be honest there are no shortcuts you need to have your core concepts very strong for this and am not talking about being the copy paste developer i mean you should “actually” know the core concepts of programming the when, what, where, why and how.
      And i believe if i can do it anyone can 😊

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

      ​@@CodeCat15 thanks for the reply
      yes I usually do copy paste work from StackOverflow and never used official documentation
      I have learned many things from u
      one question
      UIKit is still worth learning
      or we should jump on swiftui

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

    superb!

  • @suchipravasahoo535
    @suchipravasahoo535 Рік тому +1

    It’s really helpful… Thank you

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

    Nice detailed explanation. Seriously appreciate your work :)

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

      Hello Abhishek, Welcome to the channel and thank you for your kind words. Please feel free to ask questions on this topic I will be happy to answer them and do share this channel with your iOS group

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

      @@CodeCat15 Sure I will do that.

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

      Thank you @Abhishek

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

    Your way of teaching is the best.

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

      Thank you @Osaim it really means a lot, do feel free to ask questions if you have any on this topic and subscribe to the channel and share it with your iOS group.

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

      @@CodeCat15 thanks a lot man for providing this quality content for free. Kindly bring more such content, sometimes it is so happen that while working we do complex tasks but lack at basic concepts or you can say we just do things without knowing in detail, how's something is working that way. Your videos are cleaning concepts. Thanks once again

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

      @@osaimsyed4099 Its comments like these which make me happy on a Monday, thank you.
      My intentions when I started this channel was that I won't be giving bookish knowledge I wanted to explain why are we doing this and how it is helping us, and maybe do a comparison sometimes which you will see in my API, MVVM and other videos. I think everyone is creative but to enhance that creativity you need to know how things work, now I can explain the same thing in 3 minutes or I can just create 100 - 200 videos but it's quality and not quantity which matters so I may not create 200 videos but whatever I create I want to deliver quality which helps the developer community in growing their knowledge and clearing concepts than just giving bookish examples or just creating videos for namesake.

  • @gauravbisht8360
    @gauravbisht8360 Рік тому +1

    @14:30 According to me those errors were shown because those variables were let variables(immutable). I noticed, that errors were shown only for name and quantity. Please correct me if I am wrong in understanding the concept.

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

    so helpful for revising the basics..keep it up..One more thing as i am going for interview tomorrow, then can you list the questions that i might face so that it will be helpful and also for practical round

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

      Hey Nishant, how was the interview man. Hope you got selected

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

      @@CodeCat15 yeah it was good and your links helped me and got selected. Once again thank you

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

      Congratulations Nishant

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

    what is two phase initialization in swift? Read from the apple document but didn't got it.

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

      In inheritance you have a base or parent class and a child class, the child class overrides the init function of the parent class and the very first line could be super.init this is phase 1 which means before I set values of properties in the child I want the parent to be initialized first, once that is done then phase 2 begins where properties of the child class are initialized. Let me know if I was able to answer your question and if not please ask more

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

      @@CodeCat15 cool

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

    why you do not discuss convenience init?

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

      there are two videos on init, the second part has convenience init covered, here's the link for the video: ua-cam.com/video/1Rl1l7pmna8/v-deo.html
      Please do ask questions if you have on the convenience init part or any other details

  • @subhashr.p7643
    @subhashr.p7643 3 роки тому +1

    Brilliant Bro - All videos are excellent learnt many things from your youtube channel.. Thanks for the Awesome content in each and every video..

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

      Welcome to the channel Subhash, I am glad the videos are helpful. Please do share the channel with your iOS group and feel free to ask any questions on the topic

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

    Sir, structures can also inherit protocols which also may contains some more properties..but still why structures have default init method

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

      Why do you think that init has to do anything with protocols? Do check my video on protocol oriented programming as protocols are just some set of discipline that you add to your struct nothing more than that. However i feel like i have not answered your question so i request you to elaborate your question a little please

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

      To add more, an init method is a constructer, if you don’t add it in the code, swift will create one for you internally and those are default init method. In object oriented programming world you create objects via constructor.
      When it comes to protocols then they are just set of rules that you set to your class or struct (do check the protocol playlist to know more about how protocols operate)
      Struct or any class have default init method to allocate memory for them, you cannot operate on an object if its not present in the memory.
      I hope i was able to answer part of your question if not then please do ask questions, we all are here to learn and grow so all questions are welcome.
      Do share this channel with your ios group too 😊

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

      @@CodeCat15 thank u sir..... I've already recommended this channel to my grp.

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

      Thanks a bunch Raman I really appreciate the kind gesture 🙏

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

    If you add custom init in an extension of struct, you will have both the default init and a custom init.

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

      You can add custom init without an extension too no need of using an extension for doing this unless there’s a technical reason as to why you want that init to be a part of an extension than performing a function overloading.

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

    Thanks a lot brother for detailed explaination. Do you have any full paid course program for learn iOS Development from scratch? If yes then please contact me.

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

      Thank you Pratik, am glad you liked it. If you have any questions on this topic please feel free to ask. Do subscribe to the channel and share it with your iOS group too 😊

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

      @@CodeCat15 You are welcome. As far I feel you have excellent teaching skills compare to other UA-camrs. I already subscribe your channel. I kindly request you to upload more videos as per your convenience. Even you have any plan for paid teaching program. I would like to join it. Thanks a lot.

    • @CodeCat15
      @CodeCat15  4 роки тому +5

      @Pratik: Thanks a lot for your kind words, I am honored and this is the sweetest thing to say.
      I believe that knowledge should be free of charge and hence I will never charge whatsoever be it any programming language.
      I have been coding since past 10 years and i am a full stack programmer and wanted to share my experience with these tutorials.
      Just giving bookish example and repeating what we have already seen on 10 different blogs is not my way of explaining the core concepts.
      Giving hard earned money to private institutions and getting no value can be painful so learn here for free in depth 😉.
      Only when learners like you comment is when i come to know how good the video is
      I thank you from the bottom of my heart once again for your kind and motivating words.
      Never hesitate to ask me questions, I am always here for every learner like you and help them succeed.

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

    What an explanation. Thank you having us deeper understanding on this topic.