问答详情
源自:4-4 Swift2.0 默认参数值和可变参数

swift3中函数交换参数已经取消

请问老师swift3种函数调用的时候,默认值参数交换位置调用的功能是否已经取消,现在编译是错误的

提问者:qq_柏拉圖的永恆_0 2016-10-09 10:24

个回答

  • Code_浅蓝
    2016-10-13 15:29:19

    func sayHello(to name:String = "Playground", withGreetingWord greadting:String = "Hello", punctuation:String = "!") -> String {

        return "\(greadting),\(name)\(punctuation)"

    }

    sayHello()

    sayHello(to: "OC", withGreetingWord: "Bye", punctuation: "!!!")

    XCODE8 刚才手动试了下, 是不可以交换位置了