Классы / Методы

struct Foo {
    func showParams(_ a: String) {
        print("a is \"\(a)\"")
    }

    //the same name, another parameter type
    func showParams(_ a: Int) {
        print("a is \(a)")
    }

    //argument labels also make
    //an overload different
    func showParams(_ a: Int, and b: String) {
        print("a is \(a) and b is \"\(b)\"")
    }
}

let foo = Foo()
foo.showParams("A")
foo.showParams(66)
foo.showParams(66, and: "A")