When we use [UIImage initWithData:] to init, it returns nil on iOS 16 but we could get an image instance on iOS 15.
Post
Replies
Boosts
Views
Activity
We met this issue too. The compiler will crash once I access KeyPathComparator.keyPath.
Maybe we can use keyPath to access keyPath:
init(comparator: KeyPathComparator<RemoteComputer>) throws {
let path = \KeyPathComparator<RemoteComputer>.keyPath
let keyPath = comparator[keyPath: path]
switch keyPath {
case \RemoteComputer.readableName: self.init(type: .readableName, order: comparator.order)
case \RemoteComputer.lastConnectionDate: self.init(type: .lastConnectionDate, order: comparator.order)
case \RemoteComputer.numberOfConnections: self.init(type: .numberOfConnections, order: comparator.order)
default:
print("Unsupported keyPath: \(keyPath)")
throw ItemOrderError.unsupportedKeyPath
}
}