Reboot
April 20, 2020
Was bisher geschah
- letzte Folge war am 17. März 2019 (zu Swift 4.2 Zeiten)
- https://www.whatsnewinswift.com/?from=4.2&to=5.2
- 5.0
Result
- Dynamic callable
- 5.1
- Implicit return
- Opaque return types
- 5.2
- Key Path Expressions as Functions
callAsFunction
- QoL improvements
- Improved diagnostics!
- SwiftPM Dependency Resolver
- bald in 5.3
- SwiftPM Resources 🥳
- 5.0
- SwiftUI
- SwiftPM Support in Xcode \o/
Kilians Nutzen von dynamic member lookup für Wrapper-Typen:
struct A {
var foo: Int
}
@dynamicMemberLookup
struct B {
private let a: A
init() {
self.a = A(foo: 1)
}
subscript<T>(dynamicMember keyPath: KeyPath<A, T>) -> T {
a[keyPath: keyPath]
}
}
B().foo