When integrating with SwiftUI, it would be very helpful if data types like StickerSetInfo and File conform to Hashable, and for data types with an id field, also conform to Identifiable.
As a example: The new SwiftUI NavigationLink value + .navigationDestination initializer requires the value conforms to Hashable, and in ForEach and List, you can save the use of key: when elements conform to Identifiable.
Considering automatic synthesis of Hashable requirements is only available when declared in the same file, it will be a very tedious job of "implementing" a hash(into:) which basically manually hasher.combine() every field, if I want to achieve Hashable conformance without changing TDLibKit.
When integrating with SwiftUI, it would be very helpful if data types like
StickerSetInfo
andFile
conform toHashable
, and for data types with anid
field, also conform toIdentifiable
.As a example: The new SwiftUI
NavigationLink
value +.navigationDestination
initializer requires the value conforms toHashable
, and inForEach
andList
, you can save the use ofkey:
when elements conform toIdentifiable
.Considering automatic synthesis of
Hashable
requirements is only available when declared in the same file, it will be a very tedious job of "implementing" ahash(into:)
which basically manuallyhasher.combine()
every field, if I want to achieveHashable
conformance without changing TDLibKit.