AFNetworking/AFNetworking — pull request #2104 by coverback (2014-06-03 07:51:53+00:00)
Title: UIImageView allows weaker serializer subclasses

Weakened serializer from subclasses of `AFImageResponseSerializer` to any class conforming to `AFURLResponseSerialization` protocol. This allows compound serializer to be used.

Example usage is handling gifs in a `UIImage` subclass. First serialiser inside the compound one is gif handler, which only accepts `image/gif` and creates a subclass or `UIImage`. If that didn't match, `AFImageResponseSerializer` would be used and would inflate images as needed and so on.

With current realisation one would need to subclass AFImageResponseSerializer, and perform checks before calling `super`. In my opinion, this approach breaks the idea or serialiser chaining and introduces strange side effects of handling data before calling superclass. If a user needs custom still image serialisers (e.g. with filters) and on top of that gif serialisers when needed, she would need either to have hierarchy hell or overcomplicated serialiser subclass.

Allowing `AFCompoundResponseSerializer` fixes all this with a one-liner.