How to use Functions in Swift | Swift Basics #5

preview_player
Показать описание
Learn the ins and outs of using functions in Swift with this comprehensive tutorial! Discover the power of modular programming and code reusability by mastering function creation and invocation. Understand the concepts of parameters and return values to enhance the functionality of your code. Gain the skills to break down complex tasks into manageable functions. Start your journey to becoming a proficient Swift developer today and unlock the full potential of functions in your code!

🤙 WELCOME BACK 🤙

00:00 Functions
00:00 Intro
01:46 Welcome back!
03:47 Functions
05:15 Functions can call other functions
07:17 Functions control access
08:57 Returning data out of a function
11:35 Control flow in functions
13:21 Function parameters
18:40 Control flow in functions
24:02 Guard statements
29:06 Calculated variables
34:23 Wrapping up
Рекомендации по теме
Комментарии
Автор

Thank you Nick, you are the best :) SwiftBasics --> Basic Types --> Variables --> Operators --> f(x)... I am super excited for Optionals.

matthew_cramer
Автор

Please add a supplementary video of Actors in the Basics of Swift Course because now functions are not accessing the global variables within their blocks without identifying the Actor so it will be helpful for the beginners to understand what the Actors are and what do they do at this stage respect to the functions usage.

ecrsbux
Автор

Your video has ability to let me feel exciting to forget to sleep.

HaoHu-xpfg
Автор

Very helpful! thanks for the excellent free classes!🙂

Eportal-bktk
Автор

Great content. Finally I'm understanding some concepts that was so hard for me!

davidchong
Автор

@19:32. Doesn't swift infer from the parameter name that the return value type should be of type bool instead of void?

liberiskermose
Автор

you kinda sound like Mordacai from the regular show lmao, appreciate your videos so much

raquelcervantes
Автор

Please use AIDente for the sake of your laptops battery, keep it at 80% limit or perhaps 70% when its just sitting on your desk

PKperformanceEU
Автор

Hold the option button thing does not work on my computer.

isocialize
Автор

Hi Nick! Quick question, at 31:20 on line 117 of your code why did you change "value1" and "value2" to "Number1" & "Number2"? ...Why not just type Number1 & Number2 in the first place? Sorry for such a basic question but it confused me so much when small changes like that are made and I don't understand the reasoning behind the change. Thanks in advance!

jbagglesworth
Автор

Hi Nick, thanks for those awesome video content! I have been watching your videos for a month now and I like your videos and coding style the most among all other videos on YouTube. Now I have some trouble when I try to practice my own app. I wonder if you are open for giving personal tutoring lessons.

aaronq
Автор

Hi Nick! Thanks for this amazing content! Indeed, your teaching style and diction, and explanations are absolutely great and makes it really easy for people like me (with no prior knowledge to programming) to follow the lectures.

However, as I am a more visual person and it is always a lot easier for me to remember and grasp concepts more easily when I see it, do you think there is any way of integrating the Xcode and visualising what you are teaching on the screen with the iphone, where you actually see how your code changes the screen of the iphone.? Even if it is at this very beginners level - it would be so much easier to "see" waht we are doing.

I follow the lectures and really enjoy them, but at some point if there isn't a visual break to actually see and feel how it is applied to the app I get somehow fatigue from just "pure programming." I am sure there are other people like me and integrating some visualisation would help them as well.

I hope all this makes sense to you and it would help you make your amazing lectures even better!

Regards,
Villy

violetanikolova
Автор

Nick, because we are making new playgrounds for each lesson within the same file, how do you have Xcode only run the code we wrote in the current playground? Xcode is building the entire project when I run it, even when only running by clicking the blue arrow below the code, but its still pulling in code from every file and module and displaying the previous lesson print statements in every subsequent lesson... thanks!

ScottSchwartz-Owen
Автор

how do you get the info when you hi-light/hold mouse over the word?

honey.badger
Автор

Is there a performance improvement using guard vs. if else? Also, what's a realistic use of calculated variables? Great videos and series! Thanks for doing this!

marcelolewin
Автор

Is it aloud to access the function before declaring in swift ?

sujeethmemane
Автор

Why do you keep calling the function body: "closure"? Isn't closure a different type of statement?

PrivatePerson-puhv
Автор

Thanks for the amazing videos, are you going to do a video on closuers

vk
Автор

so, inside my function my variables that I created before my function are not auto-populating like yours are in your video. Do you know why this might be? It makes me go a little slower, and I don't want this to be a bad habit for the rest of my coding career.

AlexanderWebster_
Автор

In calculated variables, why you didn't use Double? I thought you would use Double for math.

guilhermemarques