Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
shopify_iossdk
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
shopify_iossdk
Commits
f9bc53ec
Commit
f9bc53ec
authored
Apr 08, 2016
by
Brent Gulanowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename BUYImage(Link)
parent
6fac2dcd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
23 additions
and
23 deletions
+23
-23
project.pbxproj
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
+0
-0
Buy.h
Mobile Buy SDK/Mobile Buy SDK/Buy.h
+1
-1
BUYImageLink.h
...e Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImageLink.h
+2
-2
BUYImageLink.m
...e Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImageLink.m
+3
-3
BUYProduct.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.h
+3
-3
BUYProduct.m
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.m
+2
-2
BUYProductView.h
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductView.h
+1
-1
BUYProductView.m
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductView.m
+2
-2
BUYProductViewController.m
...DK/Mobile Buy SDK/Product View/BUYProductViewController.m
+2
-2
BUYProductViewHeader.m
...uy SDK/Mobile Buy SDK/Product View/BUYProductViewHeader.m
+2
-2
BUYProductViewHeaderBackgroundImageView.h
...DK/Product View/BUYProductViewHeaderBackgroundImageView.h
+2
-2
BUYProductViewHeaderBackgroundImageView.m
...DK/Product View/BUYProductViewHeaderBackgroundImageView.m
+2
-2
Buy.h
Mobile Buy SDK/Mobile Buy SDK/Static Framework/Buy.h
+1
-1
No files found.
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
View file @
f9bc53ec
This diff is collapsed.
Click to expand it.
Mobile Buy SDK/Mobile Buy SDK/Buy.h
View file @
f9bc53ec
...
@@ -41,7 +41,7 @@ FOUNDATION_EXPORT const unsigned char BuyVersionString[];
...
@@ -41,7 +41,7 @@ FOUNDATION_EXPORT const unsigned char BuyVersionString[];
#import <Buy/BUYCreditCard.h>
#import <Buy/BUYCreditCard.h>
#import <Buy/BUYDiscount.h>
#import <Buy/BUYDiscount.h>
#import <Buy/BUYGiftCard.h>
#import <Buy/BUYGiftCard.h>
#import <Buy/BUYImage.h>
#import <Buy/BUYImage
Link
.h>
#import <Buy/BUYLineItem.h>
#import <Buy/BUYLineItem.h>
#import <Buy/BUYMaskedCreditCard.h>
#import <Buy/BUYMaskedCreditCard.h>
#import <Buy/BUYOption.h>
#import <Buy/BUYOption.h>
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImage.h
→
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImage
Link
.h
View file @
f9bc53ec
//
//
// BUYImage.h
// BUYImage
Link
.h
// Mobile Buy SDK
// Mobile Buy SDK
//
//
// Created by Shopify.
// Created by Shopify.
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
/**
/**
* Products are easier to sell if customers can see pictures of them, which is why there are product images.
* Products are easier to sell if customers can see pictures of them, which is why there are product images.
*/
*/
@interface
BUYImage
:
BUYObject
@interface
BUYImage
Link
:
BUYObject
/**
/**
* Specifies the location of the product image.
* Specifies the location of the product image.
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImage.m
→
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImage
Link
.m
View file @
f9bc53ec
//
//
// BUYImage.m
// BUYImage
Link
.m
// Mobile Buy SDK
// Mobile Buy SDK
//
//
// Created by Shopify.
// Created by Shopify.
...
@@ -24,10 +24,10 @@
...
@@ -24,10 +24,10 @@
// THE SOFTWARE.
// THE SOFTWARE.
//
//
#import "BUYImage.h"
#import "BUYImage
Link
.h"
#import "NSDateFormatter+BUYAdditions.h"
#import "NSDateFormatter+BUYAdditions.h"
@implementation
BUYImage
@implementation
BUYImage
Link
-
(
void
)
updateWithDictionary
:(
NSDictionary
*
)
dictionary
-
(
void
)
updateWithDictionary
:(
NSDictionary
*
)
dictionary
{
{
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.h
View file @
f9bc53ec
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#import "BUYObject.h"
#import "BUYObject.h"
@class
BUYProductVariant
;
@class
BUYProductVariant
;
@class
BUYImage
;
@class
BUYImage
Link
;
@class
BUYOption
;
@class
BUYOption
;
/**
/**
...
@@ -67,9 +67,9 @@
...
@@ -67,9 +67,9 @@
@property
(
nonatomic
,
readonly
,
copy
)
NSArray
<
BUYProductVariant
*>
*
variants
;
@property
(
nonatomic
,
readonly
,
copy
)
NSArray
<
BUYProductVariant
*>
*
variants
;
/**
/**
* A list of BUYImage objects, each one representing an image associated with the product.
* A list of BUYImage
Link
objects, each one representing an image associated with the product.
*/
*/
@property
(
nonatomic
,
readonly
,
copy
)
NSArray
<
BUYImage
*>
*
images
;
@property
(
nonatomic
,
readonly
,
copy
)
NSArray
<
BUYImage
Link
*>
*
images
;
/**
/**
* Custom product property names like "Size", "Color", and "Material".
* Custom product property names like "Size", "Color", and "Material".
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.m
View file @
f9bc53ec
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
// THE SOFTWARE.
// THE SOFTWARE.
//
//
#import "BUYImage.h"
#import "BUYImage
Link
.h"
#import "BUYOption.h"
#import "BUYOption.h"
#import "BUYProduct.h"
#import "BUYProduct.h"
#import "BUYProductVariant.h"
#import "BUYProductVariant.h"
...
@@ -45,7 +45,7 @@
...
@@ -45,7 +45,7 @@
_variants
=
[
BUYProductVariant
convertJSONArray
:
dictionary
[
@"variants"
]
block
:
^
(
BUYProductVariant
*
variant
)
{
_variants
=
[
BUYProductVariant
convertJSONArray
:
dictionary
[
@"variants"
]
block
:
^
(
BUYProductVariant
*
variant
)
{
variant
.
product
=
self
;
variant
.
product
=
self
;
}];
}];
_images
=
[
BUYImage
convertJSONArray
:
dictionary
[
@"images"
]];
_images
=
[
BUYImage
Link
convertJSONArray
:
dictionary
[
@"images"
]];
_options
=
[
BUYOption
convertJSONArray
:
dictionary
[
@"options"
]];
_options
=
[
BUYOption
convertJSONArray
:
dictionary
[
@"options"
]];
_htmlDescription
=
[
dictionary
buy_objectForKey
:
@"body_html"
];
_htmlDescription
=
[
dictionary
buy_objectForKey
:
@"body_html"
];
_available
=
[
dictionary
[
@"available"
]
boolValue
];
_available
=
[
dictionary
[
@"available"
]
boolValue
];
...
...
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductView.h
View file @
f9bc53ec
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
@class
BUYProductViewFooter
;
@class
BUYProductViewFooter
;
@class
BUYGradientView
;
@class
BUYGradientView
;
@class
BUYTheme
;
@class
BUYTheme
;
@class
BUYImage
;
@class
BUYImage
Link
;
@class
BUYProduct
;
@class
BUYProduct
;
/**
/**
...
...
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductView.m
View file @
f9bc53ec
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
#import "BUYProductVariantCell.h"
#import "BUYProductVariantCell.h"
#import "BUYProductDescriptionCell.h"
#import "BUYProductDescriptionCell.h"
#import "BUYProductHeaderCell.h"
#import "BUYProductHeaderCell.h"
#import "BUYImage.h"
#import "BUYImage
Link
.h"
#import "BUYImageView.h"
#import "BUYImageView.h"
#import "BUYProduct.h"
#import "BUYProduct.h"
#import "BUYProductViewErrorView.h"
#import "BUYProductViewErrorView.h"
...
@@ -225,7 +225,7 @@
...
@@ -225,7 +225,7 @@
page
=
(
int
)(
self
.
productViewHeader
.
collectionView
.
contentOffset
.
x
/
self
.
productViewHeader
.
collectionView
.
frame
.
size
.
width
);
page
=
(
int
)(
self
.
productViewHeader
.
collectionView
.
contentOffset
.
x
/
self
.
productViewHeader
.
collectionView
.
frame
.
size
.
width
);
}
}
[
self
.
productViewHeader
setCurrentPage
:
page
];
[
self
.
productViewHeader
setCurrentPage
:
page
];
BUYImage
*
image
=
images
[
page
];
BUYImage
Link
*
image
=
images
[
page
];
[
self
.
backgroundImageView
setBackgroundProductImage
:
image
];
[
self
.
backgroundImageView
setBackgroundProductImage
:
image
];
}
}
}
}
...
...
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductViewController.m
View file @
f9bc53ec
...
@@ -44,7 +44,7 @@
...
@@ -44,7 +44,7 @@
#import "BUYVariantSelectionViewController.h"
#import "BUYVariantSelectionViewController.h"
#import "BUYError.h"
#import "BUYError.h"
#import "BUYShop.h"
#import "BUYShop.h"
#import "BUYImage.h"
#import "BUYImage
Link
.h"
CGFloat
const
BUYMaxProductViewWidth
=
414
.
0
;
// We max out to the width of the iPhone 6+
CGFloat
const
BUYMaxProductViewWidth
=
414
.
0
;
// We max out to the width of the iPhone 6+
CGFloat
const
BUYMaxProductViewHeight
=
640
.
0
;
CGFloat
const
BUYMaxProductViewHeight
=
640
.
0
;
...
@@ -565,7 +565,7 @@ CGFloat const BUYMaxProductViewHeight = 640.0;
...
@@ -565,7 +565,7 @@ CGFloat const BUYMaxProductViewHeight = 640.0;
-
(
UICollectionViewCell
*
)
collectionView
:
(
UICollectionView
*
)
collectionView
cellForItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
-
(
UICollectionViewCell
*
)
collectionView
:
(
UICollectionView
*
)
collectionView
cellForItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
{
BUYProductImageCollectionViewCell
*
cell
=
(
BUYProductImageCollectionViewCell
*
)[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"Cell"
forIndexPath
:
indexPath
];
BUYProductImageCollectionViewCell
*
cell
=
(
BUYProductImageCollectionViewCell
*
)[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"Cell"
forIndexPath
:
indexPath
];
BUYImage
*
image
=
self
.
product
.
images
[
indexPath
.
row
];
BUYImage
Link
*
image
=
self
.
product
.
images
[
indexPath
.
row
];
NSURL
*
url
=
[
NSURL
URLWithString
:
image
.
src
];
NSURL
*
url
=
[
NSURL
URLWithString
:
image
.
src
];
[
cell
.
productImageView
loadImageWithURL
:
url
completion
:
NULL
];
[
cell
.
productImageView
loadImageWithURL
:
url
completion
:
NULL
];
[
cell
setContentOffset
:
self
.
productView
.
tableView
.
contentOffset
];
[
cell
setContentOffset
:
self
.
productView
.
tableView
.
contentOffset
];
...
...
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductViewHeader.m
View file @
f9bc53ec
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
#import "BUYImageView.h"
#import "BUYImageView.h"
#import "BUYGradientView.h"
#import "BUYGradientView.h"
#import "BUYProductImageCollectionViewCell.h"
#import "BUYProductImageCollectionViewCell.h"
#import "BUYImage.h"
#import "BUYImage
Link
.h"
#import "BUYProductVariant.h"
#import "BUYProductVariant.h"
#import "BUYTheme.h"
#import "BUYTheme.h"
#import "BUYTheme+Additions.h"
#import "BUYTheme+Additions.h"
...
@@ -206,7 +206,7 @@
...
@@ -206,7 +206,7 @@
{
{
[
self
setNumberOfPages
:[
images
count
]];
[
self
setNumberOfPages
:[
images
count
]];
if
(
CGSizeEqualToSize
(
self
.
collectionView
.
contentSize
,
CGSizeZero
)
==
NO
)
{
if
(
CGSizeEqualToSize
(
self
.
collectionView
.
contentSize
,
CGSizeZero
)
==
NO
)
{
[
images
enumerateObjectsUsingBlock
:
^
(
BUYImage
*
image
,
NSUInteger
i
,
BOOL
*
stop
)
{
[
images
enumerateObjectsUsingBlock
:
^
(
BUYImage
Link
*
image
,
NSUInteger
i
,
BOOL
*
stop
)
{
for
(
NSNumber
*
variantId
in
image
.
variantIds
)
{
for
(
NSNumber
*
variantId
in
image
.
variantIds
)
{
if
([
variantId
isEqualToNumber
:
productVariant
.
identifier
])
{
if
([
variantId
isEqualToNumber
:
productVariant
.
identifier
])
{
[
self
.
collectionView
scrollToItemAtIndexPath
:[
NSIndexPath
indexPathForRow
:
i
inSection
:
0
]
atScrollPosition
:
UICollectionViewScrollPositionCenteredHorizontally
animated
:
NO
];
[
self
.
collectionView
scrollToItemAtIndexPath
:[
NSIndexPath
indexPathForRow
:
i
inSection
:
0
]
atScrollPosition
:
UICollectionViewScrollPositionCenteredHorizontally
animated
:
NO
];
...
...
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductViewHeaderBackgroundImageView.h
View file @
f9bc53ec
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
@import
UIKit
;
@import
UIKit
;
@class
BUYImageView
;
@class
BUYImageView
;
@class
BUYTheme
;
@class
BUYTheme
;
@class
BUYImage
;
@class
BUYImage
Link
;
/**
/**
* A background for the product view that displays the currently displayed
* A background for the product view that displays the currently displayed
...
@@ -49,6 +49,6 @@
...
@@ -49,6 +49,6 @@
*
*
* @param image The currently displayed product or variant image
* @param image The currently displayed product or variant image
*/
*/
-
(
void
)
setBackgroundProductImage
:(
BUYImage
*
)
image
;
-
(
void
)
setBackgroundProductImage
:(
BUYImage
Link
*
)
image
;
@end
@end
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductViewHeaderBackgroundImageView.m
View file @
f9bc53ec
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
#import "BUYProductViewHeaderBackgroundImageView.h"
#import "BUYProductViewHeaderBackgroundImageView.h"
#import "BUYTheme.h"
#import "BUYTheme.h"
#import "BUYImageView.h"
#import "BUYImageView.h"
#import "BUYImage.h"
#import "BUYImage
Link
.h"
#import "BUYTheme+Additions.h"
#import "BUYTheme+Additions.h"
@interface
BUYProductViewHeaderBackgroundImageView
()
@interface
BUYProductViewHeaderBackgroundImageView
()
...
@@ -86,7 +86,7 @@
...
@@ -86,7 +86,7 @@
return
self
;
return
self
;
}
}
-
(
void
)
setBackgroundProductImage
:(
BUYImage
*
)
image
-
(
void
)
setBackgroundProductImage
:(
BUYImage
Link
*
)
image
{
{
NSString
*
string
=
[
image
.
src
stringByReplacingOccurrencesOfString
:[
NSString
stringWithFormat
:
@".%@"
,
[
image
.
src
pathExtension
]]
withString
:[
NSString
stringWithFormat
:
@"_small.%@"
,
[
image
.
src
pathExtension
]]];
NSString
*
string
=
[
image
.
src
stringByReplacingOccurrencesOfString
:[
NSString
stringWithFormat
:
@".%@"
,
[
image
.
src
pathExtension
]]
withString
:[
NSString
stringWithFormat
:
@"_small.%@"
,
[
image
.
src
pathExtension
]]];
NSURL
*
url
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@"
,
string
]];
NSURL
*
url
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@"
,
string
]];
...
...
Mobile Buy SDK/Mobile Buy SDK/Static Framework/Buy.h
View file @
f9bc53ec
...
@@ -37,7 +37,7 @@
...
@@ -37,7 +37,7 @@
#import "BUYCreditCard.h"
#import "BUYCreditCard.h"
#import "BUYDiscount.h"
#import "BUYDiscount.h"
#import "BUYGiftCard.h"
#import "BUYGiftCard.h"
#import "BUYImage.h"
#import "BUYImage
Link
.h"
#import "BUYLineItem.h"
#import "BUYLineItem.h"
#import "BUYMaskedCreditCard.h"
#import "BUYMaskedCreditCard.h"
#import "BUYOption.h"
#import "BUYOption.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment