Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SWIFT

Swift Multiple Return Values

func returnMultipleValues() -> (String, Int, Double) {
    return ("Swift Tuple", 12, 3.14)
}

//Calling Function
let result = returnMultipleValues()

let nameString = result.0
let intValue = result.1
let doubleValue = result.2
Source by www.simpleswiftguide.com #
 
PREVIOUS NEXT
Tagged: #Swift #Multiple #Return #Values
ADD COMMENT
Topic
Name
2+1 =