贡献者:赵大财
博客:https://my.oschina.net/zhaodacai
GitHub:https://github.com/zhaodacai
func swapTwoInts <T> ( a:inout T,b:inout T) { let temp = a a = b b = temp } var someInt = 1 var anotherInt = 5 var someString = "some" var anotherString = "another" swapValue(someInt,anotherInt) swapValue(&someString,&anotherString)原文链接:https://www.f2er.com/swift/322609.html