Commit 47bb8ca0 by Dima Bart

Add typed accessors to BUYProduct.

parent d0556ed6
......@@ -33,6 +33,23 @@
@property (nonatomic, readonly, copy) NSDate *publishedAtDate;
@property (nonatomic, readonly, copy) NSString *stringDescription;
/**
* An array of BUYImageLink objects, each one representing an image associated with the product.
*/
- (NSArray<BUYImageLink *> *)imagesArray;
/**
* Custom product property names like "Size", "Color", and "Material".
*
* An array of BUYOption objects. Products are based on permutations of these options. A product may have a maximum of 3 options. 255 characters limit each.
*/
- (NSArray<BUYOption *> *)optionsArray;
/**
* An array of BUYProductVariant objects, each one representing a slightly different version of the product.
*/
- (NSArray<BUYProductVariant *> *)variantsArray;
@end
@interface BUYProduct (Options)
......
......@@ -58,6 +58,21 @@
return _stringDescription;
}
- (NSArray<BUYImageLink *> *)imagesArray
{
return self.images.array;
}
- (NSArray<BUYOption *> *)optionsArray
{
return self.options.array;
}
- (NSArray<BUYProductVariant *> *)variantsArray
{
return self.variants.array;
}
@end
@implementation BUYProduct (Options)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment