Welcome to the Treehouse Community
Looking to learn something new?
Martina Vonkomerova7,790 Points
Method Vs Function
Can somebody tell me the different between a method and a function in Swift ?
Brandon Mowat8,186 Points
A method is a special type of function that is tied to an object. A regular old function is global and can be called wherever.
Methods are a subset of functions.
Daniel Botta17,956 Points
A function is created or called in the global scope (not within anything).
A method is a function that is found within an class, enum, or struct.
Essentially they are the same thing, but think of a method as a function that is stored within something.