Commit 4196047f by Dima Bart

Add typed collection to BUYCart.

parent 64d25a93
......@@ -27,10 +27,18 @@
#import "_BUYCart.h"
@class BUYProductVariant;
@class BUYLineItem;
@interface BUYCart : _BUYCart {}
/**
* Array of BUYCartLineItem objects in the cart
*
* These are different from BUYLineItem objects. The line item objects do include the BUYProductVariant.
*/
- (nonnull NSArray<BUYCartLineItem *> *)lineItemsArray;
/**
* Returns true if the cart is acceptable to send to Shopify.
*/
- (BOOL)isValid;
......
......@@ -40,8 +40,13 @@
}
return self;
}
#endif
- (nonnull NSArray<BUYCartLineItem *> *)lineItemsArray
{
return self.lineItems.array;
}
- (BOOL)isValid
{
return [self.lineItems count] > 0;
......
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