Reputation: 1110
I have two endpoints that return an user object. Instead of creating two RKResponseDescriptors is there a path pattern format that allows both to be used together.
RKResponseDescriptor *userResponseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:userMapping
method:RKRequestMethodAny
pathPattern:@"users"
keyPath:nil
statusCodes:[NSIndexSet indexSetWithIndex:200]];
[objectManager addResponseDescriptor:userResponseDescriptor];
RKResponseDescriptor *userAuthResponseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:userMapping
method:RKRequestMethodAny
pathPattern:@"auth"
keyPath:nil
statusCodes:[NSIndexSet indexSetWithIndex:200]];
[objectManager addResponseDescriptor:userAuthResponseDescriptor];
Is there a way to combine them?
Upvotes: 1
Views: 234
Reputation: 119031
Based on the path patterns you show in your code, no. There really isn't a lot of overhead to having 2 different response descriptors. They are separate responses. From a performance point of view you should not notice any difference.
Upvotes: 2