Is Xcode9 compatible with Swift 3 (or 3.1)?
I just started using Xcode9 (beta2). I realized that this would not force me to immediately change my code. However, I am getting build errors with the library I am using (Gloss):
1) For the following code:
public func valueForKeyPath(keyPath: String, withDelimiter delimiter: String = GlossKeyPathDelimiter, logger: Logger = GlossLogger()) -> Any? {
I get:
The initializer 'init ()' is internal and cannot refer to the default argument value
2) For this code:
internal func flatMap<KeyPrime : Hashable, ValuePrime>(_ transform: (Key, Value) throws -> (KeyPrime, ValuePrime)?) rethrows -> [KeyPrime : ValuePrime] {
return Dictionary<KeyPrime,ValuePrime>(elements: try flatMap({ (key, value) in
return try transform(key, value)
}))
}
I get:
The closure parameter tuple '(key: _, value: _)' does not support destructuring
Both of these did not cause problems with Xcode 8.3 / Swift 3.1.
I am using Xcode9 with no option to upgrade to Swift 4. There are several possibilities:
- There are several flags that need to be set to keep Swift 3.1 backward compatible.
- Xcode9 is in beta and just not completely ready
- Xcode9 will not be fully backward compatible with Swift 3.1
Thoughts?
+3
source to share
2 answers