Learn Swift for Beginners - Ep 8 - Functions Part 2

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

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

  • @CodeWithChris
    @CodeWithChris  6 лет назад +1

    QOTD ⚡Are you learning Swift as a hobby? Let me know! 👇 Kick start your own app with my free 7 Day App Action Plan ➡️ bit.ly/7dplan

  • @dhwaaneetvislot2819
    @dhwaaneetvislot2819 6 лет назад +8

    I AM WATCHING YOUR VIDEOS AND PRACTICING THEM SINCE TODAY MORNING AND WHEN I SAW HOW REST RUclipsRS TEACH, IT WAS LIKE ARE THEY SPEAKING ENGLISH????THIS SEREIS IS THE BEST

    • @CodeWithChris
      @CodeWithChris  6 лет назад +1

      THANK YOU SO MUCH SO MUCH FOR LEARNING WITH US. I HOPE YOU ARE GOING TO ENJOY THE REST OF THE LESSONS TOO!
      -Adrien

  • @luisfornes6452
    @luisfornes6452 7 лет назад +2

    by far one of the harder videos in this series to understand, either way i guess it was much easier than any other way of learning this i have found

  • @shandywriter
    @shandywriter 7 лет назад +1

    I've created apps already, but this is the first time I really understood what all the parts of the function syntax actually mean and do. Thank you for such clear explanations!

  • @srdanvujicic3484
    @srdanvujicic3484 7 лет назад +1

    Thank you for existing Chris. Very clear explanations and the best way of teaching. I finally learned something useful in my life. Cheers my friend

  • @powerliftingcyborg
    @powerliftingcyborg 5 лет назад +1

    I have to say that I'm really enjoying your 28 day code challenge! Thank you for such clear, high quality content!

    • @CodeWithChris
      @CodeWithChris  5 лет назад +1

      Thanks for learning with us! Hope you'll enjoy the other lessons too!
      -Kat

  • @CodeWithChris
    @CodeWithChris  8 лет назад +7

    In this video, you'll learn about return values and parameters in functions!

  • @dwightcollins9646
    @dwightcollins9646 7 лет назад +3

    Chris, Thank you! This video helped me finally understand these basic principles of Functions. I wish you could add this format to explain more complex coding solutions for your entire "How to make iPhone Apps..." series.

    • @CodeWithChris
      @CodeWithChris  7 лет назад

      +Dwight Collins thanks Dwight. I'll do that!

  • @NextLevelArcadeGame
    @NextLevelArcadeGame 7 лет назад +1

    some where I tried to learn function untill I found this great tutorial about function. Thank you.

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

    I came here years ago and other lessons and never continued to learn and progress but I’m here again!

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

      Great decision to come back! Best to start here: codewithchris.com/start :) -Arthur

  • @virtualmusic2
    @virtualmusic2 6 лет назад +3

    Great video! Especially loving the tip on how to logically name the parameters!! Thanks Chris!

  • @andyyermakov9441
    @andyyermakov9441 8 лет назад +13

    Hmm, I actually know it, but it's the most clear explanation I've ever heard. Good job, go on!

  • @timtimbot
    @timtimbot 6 лет назад +1

    Very good lesson. I was trying to get what underscore is using for and your lesson make it clear.

  • @ion.mardari
    @ion.mardari 8 лет назад +11

    I had some questions while watching the video, and you had the answers right away :)
    Cheers!

  • @sullivanfachner1937
    @sullivanfachner1937 6 лет назад +2

    Thank you so much! This is the only video that’s helped me understand return values.

    • @CodeWithChris
      @CodeWithChris  6 лет назад

      Awesome Sullivan! Thanks for learning with me!

  • @ranamirfan01041977
    @ranamirfan01041977 6 лет назад +1

    Simple & understand able ,Thank you for great videos.

  • @weballyorg
    @weballyorg 5 лет назад +1

    Speaking clear for my self. I use the term "method" for Object-Oriented programming, and I use the term "function" on procedural programming.

  • @romancebula1263
    @romancebula1263 6 лет назад +2

    Yeah! the clearest explanation that I've ever heard too!!!

    • @CodeWithChris
      @CodeWithChris  6 лет назад +1

      Great! We want to make sure we are as simple as possible to help anyone!
      -Adrien

  • @abdikarimpants9691
    @abdikarimpants9691 5 лет назад +1

    Thank you for these series chris!

    • @CodeWithChris
      @CodeWithChris  5 лет назад

      Welcome! Thanks for learning with us! 🙌
      -Kat

  • @Immigrantsworld
    @Immigrantsworld 7 лет назад +1

    Great Job! Keep up

  • @Mahadev-x7u
    @Mahadev-x7u 4 года назад

    Amazing lessons Chris... thank you very much

    • @CodeWithChris
      @CodeWithChris  4 года назад

      Glad to know that you are learning with us! :-) -Arthur

  • @АнтонКовалевский-о7у

    Круто мужик большое тебе Русское человеческое спасибо!

  • @didierleprince6106
    @didierleprince6106 6 лет назад +2

    Brilliant. Thanks

  • @TroyDurrance
    @TroyDurrance 7 лет назад +2

    Ok, I may have to rewatch this one... It makes sense watching it, but I'm not sure I understand which way was the best coding practice.

  • @vineelayaranagula3004
    @vineelayaranagula3004 7 лет назад +1

    you are just awesome

  • @ahsankarim9602
    @ahsankarim9602 8 лет назад +2

    Thank you for great videos.

    • @CodeWithChris
      @CodeWithChris  8 лет назад

      +Ahsan Karim thanks for learning with me!

  • @amitbhattacharjee4321
    @amitbhattacharjee4321 7 лет назад +1

    what sign is used before the arguments to alter their values as well ... like we do in c++ by adding a & sign before the argument

  • @mistapete1
    @mistapete1 7 лет назад +1

    so how long before I can make an app? Should I watch all the learn swift for beginner videos and then pursue that goal? or mingle in both worlds and watch some videos on how to make apps while watching these tutorials?

  • @retrogamingbros8164
    @retrogamingbros8164 7 лет назад +1

    You could do this...
    func hello() -> Int{
    return 5;
    }
    print(hello()) | It will print 5!

  • @vGaLaXyHD
    @vGaLaXyHD 6 лет назад +2

    thank you

  • @Main446
    @Main446 7 лет назад

    Thank YOU!!!

  • @jackster137
    @jackster137 7 лет назад

    Is Arg essentially what your variable is called outside of the function, and para is what it's called inside of the function? Thanks for the great videos by the way

  • @abdikarimpants9691
    @abdikarimpants9691 5 лет назад +1

    Would be able to add Generics and Closures to these series please? Thank you very much in advance.

    • @CodeWithChris
      @CodeWithChris  5 лет назад

      Thanks for suggesting! They're on our list!
      -Kat

  • @msphack1
    @msphack1 5 лет назад +1

    Hey Chris
    Could I request you to explain more deeper and some more easy to understand how function calling works

    • @CodeWithChris
      @CodeWithChris  5 лет назад

      Hello, we have a more updated playlist for Swift bit.ly/LearnSwift2019, it might help ruclips.net/video/AT5_lx4PbVM/видео.html
      -Kat

  • @aniltodakar6449
    @aniltodakar6449 6 лет назад +1

    Helpful Video Sir,
    But I would like to understand function complitionHandler block.
    .
    Thank You.

  • @jameshawkins9883
    @jameshawkins9883 7 лет назад

    Chris, Do you have any tutorials on Multiple tableViews? am trying to code a multi-stcked push.

  • @shawntaylor9509
    @shawntaylor9509 6 лет назад +1

    15:33 what are the underscores called or referred to as?

    • @shawntaylor9509
      @shawntaylor9509 6 лет назад +1

      Also, are they stored in memory (if so, how do you reference them), are there any other uses for the _?

    • @shawntaylor9509
      @shawntaylor9509 6 лет назад +1

      I tried this code: let _ = 12
      _ = 14
      let sum = _ + 12 and got this error: '_' can only appear in a pattern or on the left side of an assignment, what is the actual benefit of using the underscore_?

    • @CodeWithChris
      @CodeWithChris  6 лет назад +1

      This way you don't have to write the parameter names when you call the functions in your code.
      If you need the names as reference, its all good, your preference but if you want to make it short, it's possible too:
      areaOfARectangle(with: 2, length: 4)
      areaOfARectangle(2, 4)
      @AdrienVillez

    • @CodeWithChris
      @CodeWithChris  6 лет назад +1

      I never use the underscore. Sometimes you use a variable name in a function or a guard statement that is never used anywhere and Xcode will invite you to make an underscore. I never do it.
      Now like your example above, if you need that variable in the future, you have to give it a name.
      Regarding the place in memory, I do not know the answer to that. There are ways to test this but for beginners, this is not much of an issue or concern.
      @AdrienVillez

  • @MamaShareStories
    @MamaShareStories 7 лет назад +1

    What is the difference if I use func addTwoNumbers(arg para : Int) then passing the values from addTwoNumbers(arg : 2) and fucn addTwoNumbers(numbers : Int) then passing the values from addTwoNumbers(numbers : 2). You have used in 13.33 mins. Are they both alike?

  • @simonwambua3710
    @simonwambua3710 5 лет назад +1

    methods are functions belonging to a particular class. functions can be on any other scope i.e. not tied to a class

    • @CodeWithChris
      @CodeWithChris  5 лет назад

      Hello Simon, thanks for mentioning that!
      -Kat

  • @hitta750
    @hitta750 6 лет назад +1

    Wouldn't arg be an external name while param is the argument label?

  • @okgotravel3761
    @okgotravel3761 6 лет назад +4

    Methods and Functions are not the same thing. Per Hacking With Swift: "Some folks use “function” and “method” interchangeably, but there’s a small difference: both of them are reusable chunks of code, but methods belong to classes, structs, and enums, whereas functions do not."

  • @markme6620
    @markme6620 5 лет назад +1

    Make a video of functions with deep & more information..

    • @CodeWithChris
      @CodeWithChris  5 лет назад

      Yes! We can't wait to dive into deeper, detailed lessons!
      All this coming after all those basic lessons
      @AdrienVillez

  • @priyakannan6555
    @priyakannan6555 4 года назад +1

    Are u working in apple company sir

    • @CodeWithChris
      @CodeWithChris  4 года назад

      Nope, Chris never worked in Apple.
      - Kat

  • @priyakannan6555
    @priyakannan6555 4 года назад +1

    Nice super I can easier to understand

  • @ashleyalifestyle5027
    @ashleyalifestyle5027 7 лет назад

    What is the difference between printing and returning a value?

    • @colorscream
      @colorscream 7 лет назад

      print returns value to the human user, return returns the value from the function to the variable where the function was called

  • @atc2304
    @atc2304 5 лет назад +1

    good, but i wish you used examples from apps that people use daily, would've made more sense

    • @CodeWithChris
      @CodeWithChris  5 лет назад

      Thanks for the feedback! You also might want to check the updated version of this tutorial: bit.ly/LearnSwift2019
      -Kat

  • @DLP11111
    @DLP11111 6 лет назад +1

    Hey... how are you?

    • @DLP11111
      @DLP11111 6 лет назад

      I am not getting results in the side & bottom pannel.. please advice

    • @CodeWithChris
      @CodeWithChris  6 лет назад

      Hey Edge, we can help you with that in our community here: facebook.com/groups/codewithchriscommunity/

  • @aeebeecee3737
    @aeebeecee3737 5 лет назад +1

    Dose New swift need to type argument label?
    Yes we need .
    No we needn’t .

    • @CodeWithChris
      @CodeWithChris  5 лет назад

      Hello, if you meant data type label (like string, int, etc) then yes. unless you use var to declare it will use the first data type you have used
      - Francis

  • @earlofdemisegaming
    @earlofdemisegaming 7 лет назад +2

    can you help me please

    • @CodeWithChris
      @CodeWithChris  7 лет назад

      +Earl Alexander what're you having trouble with?

  • @DamLee88
    @DamLee88 7 лет назад +9

    i've understand something....

  • @ws256
    @ws256 6 лет назад +4

    I think those videos would be more helpful if you used more examples and references to some real-life projects as you speak instead of just describing each step.

    • @CodeWithChris
      @CodeWithChris  6 лет назад +1

      OK! We are working on some more detailed videos to publish on RUclips soon. We will make sure to give examples.
      -Adrien

  • @violetshark
    @violetshark 7 лет назад

    Swift's developers could make the swift more simple . I dont see any reason in require underscore char before a parameter name. Sorry but that makes no sense.

  • @retrogamingbros8164
    @retrogamingbros8164 7 лет назад +1

    So basically _ = Null

  • @aeebeecee3737
    @aeebeecee3737 5 лет назад +1

    Whatever it been called, it everything all just different type of numbers.

  • @thomasengland1701
    @thomasengland1701 5 лет назад +1

    Wouldn't you call a function a "method" when it's a function of a class.

    • @CodeWithChris
      @CodeWithChris  5 лет назад

      Yeah, we do use method and function all the time when we should indeed call them a method.
      @AdrienVillez

  • @priyakannan6555
    @priyakannan6555 4 года назад +1

    Pls reply me sir

    • @CodeWithChris
      @CodeWithChris  4 года назад

      How can we help?
      - Kat

    • @priyakannan6555
      @priyakannan6555 4 года назад

      @@CodeWithChris no sir I am asking u are ubworking in apple company or not, or where u working

    • @priyakannan6555
      @priyakannan6555 4 года назад

      @@CodeWithChris I didn't understand what u asked me sir,

    • @priyakannan6555
      @priyakannan6555 4 года назад

      @@CodeWithChris what is "how can we help Kat"

  • @priyakannan6555
    @priyakannan6555 4 года назад +1

    Because I only having the government laptop

    • @CodeWithChris
      @CodeWithChris  4 года назад

      Try the solutions here if you're using a Windows laptop: bit.ly/CWCWindows
      - Kat

    • @priyakannan6555
      @priyakannan6555 4 года назад

      @@CodeWithChris thank you for reply me sir I will try it and then I tell u back

  • @adityarajsingh5700
    @adityarajsingh5700 6 лет назад +1

    shole tu munutunus hoii....bengali baba ka shruup lagega