[swift-users] No Generic Decoders?
Jon Shier
jon at jonshier.com
Sat Sep 2 20:47:44 CDT 2017
Swift Users:
I’ve been exploring the creation of Decodable response serializers for Alamofire. However, there doesn’t actually seem to be any way to express the notion of a generic decoder. The Decoder protocol itself doesn’t require a `decode(type:from:)` method, and neither JSONDecoder or PropertyListDecoder conform to Decoder in the first place. Were these facts conscious choices or oversights? It certainly seems very useful to be able to treat decoders generically.
Jon Shier
More information about the swift-users
mailing list