AFCompoundResponseSerializer
@interface AFCompoundResponseSerializer : AFHTTPResponseSerializer
AFCompoundSerializer
is a subclass of AFHTTPResponseSerializer
that delegates the response serialization to the first AFHTTPResponseSerializer
object that returns an object for responseObjectForResponse:data:error:
, falling back on the default behavior of AFHTTPResponseSerializer
. This is useful for supporting multiple potential types and structures of server responses with a single serializer.
-
The component response serializers.
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSArray<id<AFURLResponseSerialization>> *_Nonnull responseSerializers;
Swift
var responseSerializers: [AFURLResponseSerialization] { get }
-
Creates and returns a compound serializer comprised of the specified response serializers.
Warning
Each response serializer specified must be a subclass ofAFHTTPResponseSerializer
, and response to-validateResponse:data:error:
.Declaration
Objective-C
+ (nonnull instancetype)compoundSerializerWithResponseSerializers: (nonnull NSArray<id<AFURLResponseSerialization>> *)responseSerializers;
Swift
class func compoundSerializer(withResponseSerializers responseSerializers: [AFURLResponseSerialization]) -> Self