Declare a function with return type


I want to declare a new function which takes some arguments and returns a result.


// Declare our new function
func multiply(a:Int, with:Int)->Int {
    return a*with

// Call it
let product = multiply(2, with:5)



Heard the news?

The Swift Cookbook for Swift 3 is at last here! For iBooks, Kindle and Paperback.
Hurry up - and Check it out! ;-)