Commit f9bc53ec by Brent Gulanowski

Rename BUYImage(Link)

parent 6fac2dcd
......@@ -41,7 +41,7 @@ FOUNDATION_EXPORT const unsigned char BuyVersionString[];
#import <Buy/BUYCreditCard.h>
#import <Buy/BUYDiscount.h>
#import <Buy/BUYGiftCard.h>
#import <Buy/BUYImage.h>
#import <Buy/BUYImageLink.h>
#import <Buy/BUYLineItem.h>
#import <Buy/BUYMaskedCreditCard.h>
#import <Buy/BUYOption.h>
......
//
// BUYImage.h
// BUYImageLink.h
// Mobile Buy SDK
//
// Created by Shopify.
......@@ -29,7 +29,7 @@
/**
* Products are easier to sell if customers can see pictures of them, which is why there are product images.
*/
@interface BUYImage : BUYObject
@interface BUYImageLink : BUYObject
/**
* Specifies the location of the product image.
......
//
// BUYImage.m
// BUYImageLink.m
// Mobile Buy SDK
//
// Created by Shopify.
......@@ -24,10 +24,10 @@
// THE SOFTWARE.
//
#import "BUYImage.h"
#import "BUYImageLink.h"
#import "NSDateFormatter+BUYAdditions.h"
@implementation BUYImage
@implementation BUYImageLink
- (void)updateWithDictionary:(NSDictionary *)dictionary
{
......
......@@ -27,7 +27,7 @@
#import "BUYObject.h"
@class BUYProductVariant;
@class BUYImage;
@class BUYImageLink;
@class BUYOption;
/**
......@@ -67,9 +67,9 @@
@property (nonatomic, readonly, copy) NSArray<BUYProductVariant *> *variants;
/**
* A list of BUYImage objects, each one representing an image associated with the product.
* A list of BUYImageLink objects, each one representing an image associated with the product.
*/
@property (nonatomic, readonly, copy) NSArray<BUYImage *> *images;
@property (nonatomic, readonly, copy) NSArray<BUYImageLink *> *images;
/**
* Custom product property names like "Size", "Color", and "Material".
......
......@@ -24,7 +24,7 @@
// THE SOFTWARE.
//
#import "BUYImage.h"
#import "BUYImageLink.h"
#import "BUYOption.h"
#import "BUYProduct.h"
#import "BUYProductVariant.h"
......@@ -45,7 +45,7 @@
_variants = [BUYProductVariant convertJSONArray:dictionary[@"variants"] block:^(BUYProductVariant *variant) {
variant.product = self;
}];
_images = [BUYImage convertJSONArray:dictionary[@"images"]];
_images = [BUYImageLink convertJSONArray:dictionary[@"images"]];
_options = [BUYOption convertJSONArray:dictionary[@"options"]];
_htmlDescription = [dictionary buy_objectForKey:@"body_html"];
_available = [dictionary[@"available"] boolValue];
......
......@@ -30,7 +30,7 @@
@class BUYProductViewFooter;
@class BUYGradientView;
@class BUYTheme;
@class BUYImage;
@class BUYImageLink;
@class BUYProduct;
/**
......
......@@ -32,7 +32,7 @@
#import "BUYProductVariantCell.h"
#import "BUYProductDescriptionCell.h"
#import "BUYProductHeaderCell.h"
#import "BUYImage.h"
#import "BUYImageLink.h"
#import "BUYImageView.h"
#import "BUYProduct.h"
#import "BUYProductViewErrorView.h"
......@@ -225,7 +225,7 @@
page = (int)(self.productViewHeader.collectionView.contentOffset.x / self.productViewHeader.collectionView.frame.size.width);
}
[self.productViewHeader setCurrentPage:page];
BUYImage *image = images[page];
BUYImageLink *image = images[page];
[self.backgroundImageView setBackgroundProductImage:image];
}
}
......
......@@ -44,7 +44,7 @@
#import "BUYVariantSelectionViewController.h"
#import "BUYError.h"
#import "BUYShop.h"
#import "BUYImage.h"
#import "BUYImageLink.h"
CGFloat const BUYMaxProductViewWidth = 414.0; // We max out to the width of the iPhone 6+
CGFloat const BUYMaxProductViewHeight = 640.0;
......@@ -565,7 +565,7 @@ CGFloat const BUYMaxProductViewHeight = 640.0;
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
BUYProductImageCollectionViewCell *cell = (BUYProductImageCollectionViewCell*)[collectionView dequeueReusableCellWithReuseIdentifier:@"Cell" forIndexPath:indexPath];
BUYImage *image = self.product.images[indexPath.row];
BUYImageLink *image = self.product.images[indexPath.row];
NSURL *url = [NSURL URLWithString:image.src];
[cell.productImageView loadImageWithURL:url completion:NULL];
[cell setContentOffset:self.productView.tableView.contentOffset];
......
......@@ -28,7 +28,7 @@
#import "BUYImageView.h"
#import "BUYGradientView.h"
#import "BUYProductImageCollectionViewCell.h"
#import "BUYImage.h"
#import "BUYImageLink.h"
#import "BUYProductVariant.h"
#import "BUYTheme.h"
#import "BUYTheme+Additions.h"
......@@ -206,7 +206,7 @@
{
[self setNumberOfPages:[images count]];
if (CGSizeEqualToSize(self.collectionView.contentSize, CGSizeZero) == NO) {
[images enumerateObjectsUsingBlock:^(BUYImage *image, NSUInteger i, BOOL *stop) {
[images enumerateObjectsUsingBlock:^(BUYImageLink *image, NSUInteger i, BOOL *stop) {
for (NSNumber *variantId in image.variantIds) {
if ([variantId isEqualToNumber:productVariant.identifier]) {
[self.collectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForRow:i inSection:0] atScrollPosition:UICollectionViewScrollPositionCenteredHorizontally animated:NO];
......
......@@ -27,7 +27,7 @@
@import UIKit;
@class BUYImageView;
@class BUYTheme;
@class BUYImage;
@class BUYImageLink;
/**
* A background for the product view that displays the currently displayed
......@@ -49,6 +49,6 @@
*
* @param image The currently displayed product or variant image
*/
- (void)setBackgroundProductImage:(BUYImage *)image;
- (void)setBackgroundProductImage:(BUYImageLink *)image;
@end
......@@ -27,7 +27,7 @@
#import "BUYProductViewHeaderBackgroundImageView.h"
#import "BUYTheme.h"
#import "BUYImageView.h"
#import "BUYImage.h"
#import "BUYImageLink.h"
#import "BUYTheme+Additions.h"
@interface BUYProductViewHeaderBackgroundImageView ()
......@@ -86,7 +86,7 @@
return self;
}
- (void)setBackgroundProductImage:(BUYImage *)image
- (void)setBackgroundProductImage:(BUYImageLink *)image
{
NSString *string = [image.src stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@".%@", [image.src pathExtension]] withString:[NSString stringWithFormat:@"_small.%@", [image.src pathExtension]]];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@", string]];
......
......@@ -37,7 +37,7 @@
#import "BUYCreditCard.h"
#import "BUYDiscount.h"
#import "BUYGiftCard.h"
#import "BUYImage.h"
#import "BUYImageLink.h"
#import "BUYLineItem.h"
#import "BUYMaskedCreditCard.h"
#import "BUYOption.h"
......
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