Tuple splat syntax is deprecated
About 2 min
Tuple splat syntax is deprecated 관련
HACKING WITH SWIFT
What's new in Swift?
Tuple splat syntax is deprecated | Changes in Swift 2.22.2
Tuple splat syntax is deprecated
Available from Swift 2.2
Another feature that has been deprecated is one that has been part of Swift since 2010 (yes, years before it launched). It's been named "the tuple splat", and not many people were using it. It's partly for that reason – although mainly because it introduces all sorts of ambiguities when reading code – that this syntax is being deprecated.
In case you were curious – and let's face it, you probably are – here's an example of tuple splat syntax in action:
func describePerson(name: String, age: Int) {
print("\(name) is \(age) years old")
}
let person = ("Taylor Swift", age: 26)
describePerson(person)
But remember: don't grow too fond of your new knowledge, because tuple splats are deprecated in Swift 2.2 and will be removed entirely in a later version.
Other changes in Swift 2.2…
++ and -- are deprecated | Changes in Swift 2.2
++ and -- are deprecated
Traditional C-style for loops are deprecated | Changes in Swift 2.2
Traditional C-style for loops are deprecated
Comparing tuples | Changes in Swift 2.2
Comparing tuples
More keywords can be used as argument labels | Changes in Swift 2.2
More keywords can be used as argument labels
Variable parameters have been deprecated | Changes in Swift 2.2
Variable parameters have been deprecated
Renamed debug identifiers: line, function, file | Changes in Swift 2.2
Renamed debug identifiers: line, function, file
Stringified selectors are deprecated | Changes in Swift 2.2
Stringified selectors are deprecated
Compile-time Swift version checking | Changes in Swift 2.2
Compile-time Swift version checking