I've just started using Xcode9 (beta2). My understanding was that it wouldn't force me to immediately change my code. However, I'm getting a build errors coming up with a library I'm using (Gloss):
1) For the following code:
public func valueForKeyPath(keyPath: String, withDelimiter delimiter: String = GlossKeyPathDelimiter, logger: Logger = GlossLogger()) -> Any? {
I get:
Initializer 'init()' is internal and cannot be referenced from a 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'm getting:
Closure tuple parameter '(key: _, value: _)' does not support destructuring
Both of these caused no problem with Xcode 8.3/Swift 3.1.
I am using Xcode9 without having chosen the option to update to Swift 4. There seems several possibilities:
Thoughts?
Xcode 9 is cross compatible with Swift 3 and 4. However, you need to be on Swift 3.2 which is the minimum for Xcode 9.