LCCompoundResponseSerializer
Objective-C
@interface LCCompoundResponseSerializer : LCHTTPResponseSerializer
Swift
class LCCompoundResponseSerializer : LCHTTPResponseSerializer
LCCompoundSerializer
is a subclass of LCHTTPResponseSerializer
that delegates the response serialization to the first LCHTTPResponseSerializer
object that returns an object for responseObjectForResponse:data:error:
, falling back on the default behavior of LCHTTPResponseSerializer
. 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<LCURLResponseSerialization>> *_Nonnull responseSerializers;
Swift
var responseSerializers: [LCURLResponseSerialization] { get }
-
Creates and returns a compound serializer comprised of the specified response serializers.
Warning
Each response serializer specified must be a subclass ofLCHTTPResponseSerializer
, and response to-validateResponse:data:error:
.Declaration
Objective-C
+ (nonnull instancetype)compoundSerializerWithResponseSerializers: (nonnull NSArray<id<LCURLResponseSerialization>> *)responseSerializers;
Swift
class func compoundSerializer(withResponseSerializers responseSerializers: [LCURLResponseSerialization]) -> Self