Is there a way to extend an Array when the element is a type of tuple ?
public extension Array where Element: (timeZoneName: String, formattedName: String){
}
This declaration returns 4 errors:
- Statement cannot begin with a closure expression
- Braced block statements is an unused closure
- Expected '{' in extension
- Expected identifier for type name
I can't tell if the errors shown are accurate. Any ideas?
Swift 3 version of appzYourLife's answer:
extension Sequence where Iterator.Element == Tuple2 {
func foo() {}
}
It's now possible in Swift 3.1.
extension Array where Element == (String, String) {
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With