What is the difference between functions and methods in Swift?

self-contained blocks of code ideally set to perform a specific task.

Functions are globally defined and scoped.

Methods are defined and belong to a certain class type.