Functions and methods can be used interchangeably, but there is a small difference between both of them. Methods belong to struts, classes, and enums, but functions do not.
Syntax :
func thisIsAFunction1() {
}
struct Person {
func thisIsAMethod1() {
}
}