Hello, my name is Mark Nair, and in these lessons you'll learn about functions and closures in Swift. On first looking at how we overload a function, so overloading a function means you make different functions of the same name, you just implement them in a different way. So let's look at a few examples. I'll make a function called birthdaygreens. So very simple function, let's call that, and when I call it you see in the popup, I have this one option, which is birthday greetings two, birthday greetings two, Mark, and just to quickly go over it, keyword, the name of the function, the label, the name of my argument, the type, let's overload this function. I'll make a new function, and I will call it birthday greetings. Now this is identical to what we had before, but this time I'm going to add a new parameter from friend. So these two functions, same name, right here. I'm overloading it, but in this case I have a different parameter, a new argument in here. Now when I call the function, in my popup, I have birthday greetings two, birthday greetings two, and from, Charlie wishes you a happy birthday Sally. Let's overload this function yet again, but this time with a different type as a parameter. Now in this case, I'm just going to copy this. Now two and from, instead of from, I'll just use age, and now I have a different type inside of my parameter list, and there we go. Now when I call the function, birthday greetings two, birthday greetings two, from, birthday greetings two, from two and age, and you'll see in the description of the very bottom of this popup window, two is string, two and from, type string, two, type string, ages of type int, exactly what we said I'm on 11. Let's overload this function yet again, this time I'm going to copy this whole thing here. I'm going to overload it with the change of the label. Instead of adding a new parameter, I'm just changing the label, so for name. Now what I'll do inside of here is I'll actually change the print so we can see the distinction. Now when I call the function, birthday greetings two, we see the list now of what I'm overloading, and then down here, four, there we go, this is the birthday card for Hank. So that's overloading a function with the different ways of doing it. I do want to show you how you can overload a function with a different return type. So all of these right now, we're not really returning any values, we're just printing a string, but let's do that with two new functions. This function is temperature check, and from this I will return a string. That's the temperature check, depending where I will stop. Now I will make a new function, but in this time I'm going to return an int. So two functions, overloading them, but depending on the return type. Now if I call this function, see right here, temperature check, and then it says plus one more, press the right arrow to see more. So if I press the right arrow, I see temperature check with the string return in the int. If I select the string return, I just get the temperature check, and if I do it again, and if I select the int return, they're identical. So how do I use one, and if it's a different term type, what do I do? Well, we have to be very specific in how we want to use this, and the way we do this is of course, just set up a new constant here. So tap message is equal to temperature check, but it's still ambiguous and I'll still have an error. What I have to do is be very specific on the type, what I just set up. So in this case, I'll have type of string. Now when I run this, the value is it's hot right here. I go ahead and print this so we can really see it. If I come back in here and change this type to int, the value will change to 99, and that's how I make the distinction between these two overloads out of the return type. This is a little tricky, you have to be very careful about in your code what you're doing so you can be very explicit both to yourself and to your code about what you want. But that's how we do the overloading. Thanks for watching. Stay tuned for the next lesson where I'll show you how to use variadic functions.