There is no legend available for one of the layer in a map service. If you are loading just one layer from a map service then it must be an AGSFeatureLayer, correct?
If yes, you should get the swatch from the renderer symbol. See below code...
CGSize swatchSize = CGSizeMake(20,20);
//check the renderer of feature layer
if ([self.featureLayer.renderer isKindOfClass:[AGSUniqueValueRenderer class]]) {
AGSUniqueValueRenderer *uniqueValueRenderer = (AGSUniqueValueRenderer*)self.featureLayer.renderer;
//you can loop through all symbols and get swatchs
AGSUniqueValue *uniqueValue = [uniqueValueRenderer.uniqueValues objectAtIndex:0];
UIImage *image = [uniqueValue.symbol swatchForGeometryType:self.featureLayer.geometryType size:swatchSize];
}
Please let me know if you need any further help!
Regards,
Nimesh