import Foundation
//Swift 复数变量定义
let myStatus = (411, "大连")
println(myStatus.0)
println(myStatus.1)
//Swift 复数变量定义(带标签)
let myStatusWithlabel: (code: Int, text: String) = (411, "大连")
println(myStatusWithlabel.code)
println(myStatusWithlabel.1)
let myStatusThree: (code: Int, text: String, tel: String) = (411, "大连", "080")
println(myStatusThree.code)
println(myStatusThree.1)
println(myStatusThree.tel)
//Swift 复数变量的赋值
let status = (411, "大连")
let (_, msg) = status //此处只为变量msg赋值
println(msg)
Swift 复数变量定义
最新推荐文章于 2022-04-06 14:26:08 发布