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
6c6a94a5
Commit
6c6a94a5
authored
Jun 07, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add nullability annotation to model classes.
parent
2025e5fe
Show whitespace changes
Inline
Side-by-side
Showing
41 changed files
with
178 additions
and
117 deletions
+178
-117
BUYApplePayAdditionsTest.m
...e Buy SDK/Mobile Buy SDK Tests/BUYApplePayAdditionsTest.m
+1
-1
BUYIntegrationTest.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYIntegrationTest.m
+1
-1
BUYLineItemTest.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYLineItemTest.m
+1
-1
BUYObjectTests.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYObjectTests.m
+1
-1
BUYAccountCredentials.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYAccountCredentials.h
+0
-0
BUYCreditCard.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCreditCard.h
+8
-5
BUYError.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYError.h
+7
-5
BUYError.m
Mobile Buy SDK/Mobile Buy SDK/Models/BUYError.m
+1
-1
BUYManagedObject.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYManagedObject.h
+9
-7
BUYModelManager.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYModelManager.h
+5
-3
BUYModelManagerProtocol.h
...e Buy SDK/Mobile Buy SDK/Models/BUYModelManagerProtocol.h
+6
-3
BUYObject.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObject.h
+6
-4
BUYObjectProtocol.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObjectProtocol.h
+8
-5
BUYPaymentToken.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYPaymentToken.h
+4
-0
BUYSerializable.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYSerializable.h
+3
-0
BUYAddress.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYAddress.h
+4
-1
BUYCart.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCart.h
+7
-4
BUYCart.m
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCart.m
+2
-2
BUYCartLineItem.h
...uy SDK/Mobile Buy SDK/Models/Persistent/BUYCartLineItem.h
+4
-2
BUYCollection.h
... Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCollection.h
+4
-1
BUYCollection.m
... Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCollection.m
+1
-1
BUYCustomer.h
...le Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCustomer.h
+5
-2
BUYImageLink.h
...e Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImageLink.h
+4
-2
BUYImageLink.m
...e Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImageLink.m
+7
-31
BUYLineItem.h
...le Buy SDK/Mobile Buy SDK/Models/Persistent/BUYLineItem.h
+8
-5
BUYOption.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOption.h
+4
-1
BUYOptionValue.h
...Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOptionValue.h
+5
-2
BUYOrder.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOrder.h
+4
-1
BUYOrder.m
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOrder.m
+1
-1
BUYProduct.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.h
+6
-2
BUYProduct.m
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.m
+3
-3
BUYProductVariant.h
... SDK/Mobile Buy SDK/Models/Persistent/BUYProductVariant.h
+5
-2
BUYShop.h
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYShop.h
+4
-1
BUYCheckout.h
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckout.h
+7
-5
BUYCheckout.m
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckout.m
+2
-2
BUYCheckoutAttribute.h
...DK/Mobile Buy SDK/Models/Transient/BUYCheckoutAttribute.h
+5
-1
BUYDiscount.h
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYDiscount.h
+8
-3
BUYGiftCard.h
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYGiftCard.h
+5
-2
BUYMaskedCreditCard.h
...SDK/Mobile Buy SDK/Models/Transient/BUYMaskedCreditCard.h
+4
-1
BUYShippingRate.h
...Buy SDK/Mobile Buy SDK/Models/Transient/BUYShippingRate.h
+4
-1
BUYTaxLine.h
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYTaxLine.h
+4
-1
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYApplePayAdditionsTest.m
View file @
6c6a94a5
...
...
@@ -47,7 +47,7 @@
-
(
void
)
setUp
{
_modelManager
=
[
BUYModelManager
modelManager
];
_checkout
=
[[
BUYCheckout
alloc
]
initWithModelManager
:
_modelManager
cart
:
nil
];
_checkout
=
[[
BUYCheckout
alloc
]
initWithModelManager
:
_modelManager
cart
:
[
BUYCart
new
]
];
}
-
(
void
)
tearDown
...
...
Mobile Buy SDK/Mobile Buy SDK Tests/BUYIntegrationTest.m
View file @
6c6a94a5
...
...
@@ -766,7 +766,7 @@
{
[
OHHTTPStubs
stubUsingResponseWithKey
:
@"testFetchingShippingRatesWithInvalidCheckout_1"
useMocks
:[
self
shouldUseMocks
]];
BUYCheckout
*
checkout
=
[[
BUYCheckout
alloc
]
initWithModelManager
:
_modelManager
cart
:
nil
];
BUYCheckout
*
checkout
=
[[
BUYCheckout
alloc
]
initWithModelManager
:
_modelManager
cart
:
[
BUYCart
new
]
];
checkout
.
token
=
@"bananaaaa"
;
XCTestExpectation
*
expectation
=
[
self
expectationWithDescription
:
NSStringFromSelector
(
_cmd
)];
...
...
Mobile Buy SDK/Mobile Buy SDK Tests/BUYLineItemTest.m
View file @
6c6a94a5
...
...
@@ -70,7 +70,7 @@
-
(
void
)
testJsonDictionaryDoesntIncludeVariantsWithoutIds
{
_lineItem
=
[
_modelManager
lineItemWithVariant
:
nil
];
_lineItem
=
[
_modelManager
lineItemWithVariant
:
[
BUYProductVariant
new
]
];
NSDictionary
*
json
=
[
_lineItem
jsonDictionaryForCheckout
];
XCTAssertNotNil
(
json
);
XCTAssertNil
(
json
[
@"variant_id"
]);
...
...
Mobile Buy SDK/Mobile Buy SDK Tests/BUYObjectTests.m
View file @
6c6a94a5
...
...
@@ -122,7 +122,7 @@
-
(
BUYDirtyTracked
*
)
dirtyTrackedObject
{
return
[[
BUYDirtyTracked
alloc
]
initWithModelManager
:
nil
JSONDictionary
:
nil
];
return
[[
BUYDirtyTracked
alloc
]
initWithModelManager
:
[
BUYModelManager
modelManager
]
JSONDictionary
:
nil
];
}
@end
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/BUYAccountCredentials.h
View file @
6c6a94a5
Mobile Buy SDK/Mobile Buy SDK/Models/BUYCreditCard.h
View file @
6c6a94a5
...
...
@@ -26,6 +26,7 @@
@import
Foundation
;
#import <Buy/BUYSerializable.h>
NS_ASSUME_NONNULL_BEGIN
/**
* This represents raw credit card data that the user is posting. You MUST discard this object as soon as it has been posted
...
...
@@ -37,27 +38,29 @@
* The full name on the credit card
* First and Last in this format: 'First Last'.
*/
@property
(
nonatomic
,
copy
)
NSString
*
nameOnCard
;
@property
(
nonatomic
,
nullable
,
copy
)
NSString
*
nameOnCard
;
/**
* The full credit card number.
* This should be a numerical value without spaces, dashes or any other special characters.
*/
@property
(
nonatomic
,
copy
)
NSString
*
number
;
@property
(
nonatomic
,
nullable
,
copy
)
NSString
*
number
;
/**
* The month that the credit card expires, as a numerical value (i.e. 12 for December).
*/
@property
(
nonatomic
,
copy
)
NSString
*
expiryMonth
;
@property
(
nonatomic
,
nullable
,
copy
)
NSString
*
expiryMonth
;
/**
* The last two digits of the year in which the credit card expires (i.e. 18 for 2018).
*/
@property
(
nonatomic
,
copy
)
NSString
*
expiryYear
;
@property
(
nonatomic
,
nullable
,
copy
)
NSString
*
expiryYear
;
/**
* The Card Verification Value number (or whichever card security code should be used for the card type).
*/
@property
(
nonatomic
,
copy
)
NSString
*
cvv
;
@property
(
nonatomic
,
nullable
,
copy
)
NSString
*
cvv
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYError.h
View file @
6c6a94a5
...
...
@@ -25,15 +25,17 @@
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYError
:
NSObject
@property
(
nonatomic
,
copy
)
NSString
*
key
;
@property
(
nonatomic
,
nonnull
,
copy
,
readonly
)
NSString
*
key
;
@property
(
nonatomic
,
nullable
,
copy
,
readonly
)
NSString
*
code
;
@property
(
nonatomic
,
nullable
,
copy
,
readonly
)
NSString
*
message
;
@property
(
nonatomic
,
nullable
,
copy
,
readonly
)
NSDictionary
<
NSString
*
,
NSString
*>
*
options
;
-
(
instancetype
)
initWithKey
:(
NSString
*
)
key
json
:(
NSDictionary
*
)
json
;
@property
(
nonatomic
,
copy
)
NSString
*
code
;
@property
(
nonatomic
,
copy
)
NSString
*
message
;
@property
(
nonatomic
,
copy
)
NSDictionary
<
NSString
*
,
NSString
*>
*
options
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYError.m
View file @
6c6a94a5
...
...
@@ -32,7 +32,7 @@
{
self
=
[
super
init
];
if
(
self
)
{
self
.
key
=
key
;
_key
=
[
key
copy
]
;
[
self
setValuesForKeysWithDictionary
:
json
];
}
return
self
;
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/BUYManagedObject.h
View file @
6c6a94a5
...
...
@@ -25,8 +25,8 @@
//
#import <CoreData/CoreData.h>
#import <Buy/BUYObject.h>
#import "BUYObject.h"
NS_ASSUME_NONNULL_BEGIN
#if defined CORE_DATA_PERSISTENCE
...
...
@@ -42,7 +42,7 @@
@interface
BUYManagedObject
:
NSManagedObject
<
BUYObject
>
-
(
nonnull
instancetype
)
init
NS_UNAVAILABLE
;
-
(
instancetype
)
init
NS_UNAVAILABLE
;
@end
...
...
@@ -56,11 +56,13 @@
*/
@interface
BUYObject
(
BUYManagedObjectConformance
)
-
(
void
)
willAccessValueForKey
:(
nonnull
NSString
*
)
key
;
-
(
void
)
didAccessValueForKey
:(
nonnull
NSString
*
)
key
;
-
(
void
)
willAccessValueForKey
:(
NSString
*
)
key
;
-
(
void
)
didAccessValueForKey
:(
NSString
*
)
key
;
-
(
nullable
id
)
primitiveValueForKey
:(
nonnull
NSString
*
)
key
;
-
(
void
)
setPrimitiveValue
:(
nullable
id
)
value
forKey
:(
nonnull
NSString
*
)
key
;
-
(
nullable
id
)
primitiveValueForKey
:(
NSString
*
)
key
;
-
(
void
)
setPrimitiveValue
:(
nullable
id
)
value
forKey
:(
NSString
*
)
key
;
@end
#endif
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYModelManager.h
View file @
6c6a94a5
...
...
@@ -25,9 +25,9 @@
//
#import <Foundation/Foundation.h>
#import
<Buy/BUYObject.h>
#import <Buy/BUYModelManagerProtocol.h>
#import "BUYObject.h"
#import
"BUYModelManagerProtocol.h"
NS_ASSUME_NONNULL_BEGIN
/**
* A basic implementation of the BUYModelManager interface that does no caching. New objects are created using alloc/init.
...
...
@@ -54,3 +54,5 @@
+
(
instancetype
)
modelManager
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYModelManagerProtocol.h
View file @
6c6a94a5
...
...
@@ -25,6 +25,7 @@
//
#import <CoreData/CoreData.h>
NS_ASSUME_NONNULL_BEGIN
@protocol
BUYObject
;
...
...
@@ -52,7 +53,7 @@
*
* @return A new or existing model object.
*/
-
(
id
<
BUYObject
>
)
buy_objectWithEntityName
:(
NSString
*
)
entityName
JSONDictionary
:(
NSDictionary
*
)
JSON
;
-
(
id
<
BUYObject
>
)
buy_objectWithEntityName
:(
NSString
*
)
entityName
JSONDictionary
:(
nullable
NSDictionary
*
)
JSON
;
-
(
NSArray
<
id
<
BUYObject
>>
*
)
buy_objectsWithEntityName
:(
NSString
*
)
entityName
JSONArray
:(
NSArray
*
)
JSON
;
/**
...
...
@@ -64,7 +65,7 @@
*
* @return An object from the cache matching the provided identifier, or nil if no matching object is found.
*/
-
(
id
<
BUYObject
>
)
buy_objectWithEntityName
:(
NSString
*
)
entityName
identifier
:(
NSNumber
*
)
identifier
;
-
(
nullable
id
<
BUYObject
>
)
buy_objectWithEntityName
:(
NSString
*
)
entityName
identifier
:(
NSNumber
*
)
identifier
;
/**
* Find all the objects in the cache matching the provided identifiers.
...
...
@@ -74,7 +75,7 @@
*
* @return An array of objects from the cache matching the provided identifiers, if any.
*/
-
(
NSArray
<
id
<
BUYObject
>>
*
)
buy_objectsWithEntityName
:(
NSString
*
)
entityName
identifiers
:(
NSArray
*
)
identifiers
;
-
(
NSArray
<
id
<
BUYObject
>>
*
)
buy_objectsWithEntityName
:(
NSString
*
)
entityName
identifiers
:(
nullable
NSArray
*
)
identifiers
;
/**
* If there is a local cache available, and the object is cached, it is flushed from the cache. Depending on the type of
...
...
@@ -109,3 +110,5 @@
-
(
BOOL
)
buy_purgeObjectsWithEntityName
:(
NSString
*
)
entityName
matchingPredicate
:(
NSPredicate
*
)
predicate
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObject.h
View file @
6c6a94a5
...
...
@@ -25,9 +25,9 @@
//
#import <Foundation/Foundation.h>
#import
<Buy/BUYObjectProtocol.h>
#import <Buy/BUYModelManagerProtocol.h>
#import "BUYObjectProtocol.h"
#import
"BUYModelManagerProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYObject
:
NSObject
<
BUYObject
>
...
...
@@ -37,8 +37,10 @@
*/
@property
(
nonatomic
,
readonly
,
getter
=
isDirty
)
BOOL
dirty
;
-
(
NSSet
*
)
dirtyProperties
;
-
(
nullable
NSSet
*
)
dirtyProperties
;
-
(
void
)
markPropertyAsDirty
:(
NSString
*
)
property
;
-
(
void
)
markAsClean
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObjectProtocol.h
View file @
6c6a94a5
...
...
@@ -25,7 +25,8 @@
//
#import <Foundation/Foundation.h>
#import <Buy/BUYSerializable.h>
#import "BUYSerializable.h"
NS_ASSUME_NONNULL_BEGIN
@class
NSEntityDescription
;
...
...
@@ -37,12 +38,12 @@
*/
@protocol
BUYObject
<
BUYSerializable
>
@property
(
nonatomic
,
readonly
,
weak
)
id
<
BUYModelManager
>
modelManager
;
@property
(
nonatomic
,
readonly
,
nullable
,
weak
)
id
<
BUYModelManager
>
modelManager
;
/**
* Transient model objects need an entity for introspection.
*/
@property
(
nonatomic
,
readonly
,
weak
)
NSEntityDescription
*
entity
;
@property
(
nonatomic
,
readonly
,
nullable
,
weak
)
NSEntityDescription
*
entity
;
/**
* A dictionary of @{ NSString : NSPropertyDescription } where the keys are property names.
...
...
@@ -63,7 +64,7 @@
/**
* A predicate composed of values from the JSON. For objects that do not have an "identifier"/"id" property.
*/
+
(
NSPredicate
*
)
fetchPredicateWithJSON
:(
NSDictionary
*
)
JSONDictionary
;
+
(
nullable
NSPredicate
*
)
fetchPredicateWithJSON
:(
NSDictionary
*
)
JSONDictionary
;
/**
* Persistent classes return YES; transient classes return NO.
...
...
@@ -77,6 +78,8 @@
@optional
-
(
instancetype
)
initWithModelManager
:
(
id
<
BUYModelManager
>
)
modelManager
JSONDictionary
:
(
NSDictionary
*
)
dictionary
;
-
(
instancetype
)
initWithModelManager
:
(
id
<
BUYModelManager
>
)
modelManager
JSONDictionary
:
(
nullable
NSDictionary
*
)
dictionary
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYPaymentToken.h
View file @
6c6a94a5
...
...
@@ -24,8 +24,12 @@
// THE SOFTWARE.
//
NS_ASSUME_NONNULL_BEGIN
@protocol
BUYPaymentToken
<
NSObject
>
-
(
NSDictionary
*
)
JSONDictionary
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/BUYSerializable.h
View file @
6c6a94a5
...
...
@@ -25,6 +25,7 @@
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@protocol
BUYSerializable
<
NSObject
>
...
...
@@ -35,3 +36,5 @@
@interface
NSDictionary
(
BUYSerializable
)
<
BUYSerializable
>
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYAddress.h
View file @
6c6a94a5
...
...
@@ -24,7 +24,8 @@
// THE SOFTWARE.
//
#import <Buy/_BUYAddress.h>
#import "_BUYAddress.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYAddress
:
_BUYAddress
{}
...
...
@@ -47,3 +48,5 @@
-
(
BOOL
)
isValidAddressForShippingRates
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCart.h
View file @
6c6a94a5
...
...
@@ -25,6 +25,7 @@
//
#import <Buy/_BUYCart.h>
NS_ASSUME_NONNULL_BEGIN
@class
BUYProductVariant
;
@class
BUYLineItem
;
...
...
@@ -36,7 +37,7 @@
*
* These are different from BUYLineItem objects. The line item objects do include the BUYProductVariant.
*/
-
(
nonnull
NSArray
<
BUYCartLineItem
*>
*
)
lineItemsArray
;
-
(
NSArray
<
BUYCartLineItem
*>
*
)
lineItemsArray
;
/**
* Returns true if the cart is acceptable to send to Shopify.
...
...
@@ -56,7 +57,7 @@
*
* @param variant The BUYProductVariant to add to the BUYCart or increase by one quantity
*/
-
(
void
)
addVariant
:(
nonnull
BUYProductVariant
*
)
variant
;
-
(
void
)
addVariant
:(
BUYProductVariant
*
)
variant
;
/**
* Removes the BUYCartLineItem from the BUYCart associated with the given BUYProductVariant object.
...
...
@@ -64,7 +65,7 @@
*
* @param variant The BUYProductVariant to remove from the BUYCart or decrease by one quantity
*/
-
(
void
)
removeVariant
:(
nonnull
BUYProductVariant
*
)
variant
;
-
(
void
)
removeVariant
:(
BUYProductVariant
*
)
variant
;
/**
* Adds a BUYCartLineItem with a set quantity to the BUYCart with the given BUYProductVariant object on it.
...
...
@@ -74,6 +75,8 @@
* @param variant The BUYProductVariant to add to the BUYCart with a quantity
* @param quantity The quantity for the BUYCartLineItem associated with the BUYProductVariant
*/
-
(
void
)
setVariant
:(
nonnull
BUYProductVariant
*
)
variant
withTotalQuantity
:(
NSInteger
)
quantity
;
-
(
void
)
setVariant
:(
BUYProductVariant
*
)
variant
withTotalQuantity
:(
NSInteger
)
quantity
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCart.m
View file @
6c6a94a5
...
...
@@ -42,9 +42,9 @@
}
#endif
-
(
nonnull
NSArray
<
BUYCartLineItem
*>
*
)
lineItemsArray
-
(
NSArray
<
BUYCartLineItem
*>
*
)
lineItemsArray
{
return
self
.
lineItems
.
array
;
return
self
.
lineItems
.
array
?:
@[]
;
}
-
(
BOOL
)
isValid
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCartLineItem.h
View file @
6c6a94a5
...
...
@@ -24,12 +24,12 @@
// THE SOFTWARE.
//
#import <Buy/_BUYCartLineItem.h>
#import "_BUYCartLineItem.h"
NS_ASSUME_NONNULL_BEGIN
/**
* Newly inserted `CartLineItem`s have an initial quantity of 1.
*/
@interface
BUYCartLineItem
:
_BUYCartLineItem
{}
/**
...
...
@@ -69,3 +69,5 @@
-
(
BUYCartLineItem
*
)
cartLineItemWithVariant
:(
BUYProductVariant
*
)
variant
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCollection.h
View file @
6c6a94a5
...
...
@@ -26,10 +26,11 @@
#import <Buy/_BUYCollection.h>
#import <Buy/BUYClient+Storefront.h>
NS_ASSUME_NONNULL_BEGIN
@interface
BUYCollection
:
_BUYCollection
{}
@property
(
nonatomic
,
readonly
)
NSString
*
stringDescription
;
@property
(
nonatomic
,
nullable
,
readonly
)
NSString
*
stringDescription
;
-
(
NSArray
<
BUYProduct
*>
*
)
productsArray
;
...
...
@@ -43,3 +44,5 @@
+
(
NSString
*
)
sortOrderParameterForCollectionSort
:(
BUYCollectionSort
)
sort
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCollection.m
View file @
6c6a94a5
...
...
@@ -34,7 +34,7 @@
-
(
NSArray
<
BUYProduct
*>
*
)
productsArray
{
return
self
.
products
.
array
;
return
self
.
products
.
array
?:
@[]
;
}
-
(
void
)
updateStringDescription
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYCustomer.h
View file @
6c6a94a5
...
...
@@ -24,11 +24,12 @@
// THE SOFTWARE.
//
#import <Buy/_BUYCustomer.h>
#import "_BUYCustomer.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYCustomer
:
_BUYCustomer
{}
@property
(
readonly
)
NSString
*
fullName
;
@property
(
nonatomic
,
strong
,
readonly
)
NSString
*
fullName
;
@end
...
...
@@ -37,3 +38,5 @@
-
(
BUYCustomer
*
)
customerWithJSONDictionary
:(
NSDictionary
*
)
json
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImageLink.h
View file @
6c6a94a5
...
...
@@ -24,9 +24,9 @@
// THE SOFTWARE.
//
#import <Buy/_BUYImageLink.h>
@import
UIKit
;
#import "_BUYImageLink.h"
NS_ASSUME_NONNULL_BEGIN
// Defines for common maximum image sizes
typedef
NS_ENUM
(
NSUInteger
,
BUYImageURLSize
)
{
...
...
@@ -83,3 +83,5 @@ typedef NS_ENUM(NSUInteger, BUYImageURLSize) {
-
(
BUYImageURLSize
)
buy_imageSize
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImageLink.m
View file @
6c6a94a5
...
...
@@ -51,39 +51,15 @@
+
(
NSString
*
)
keyForImageSize
:(
BUYImageURLSize
)
size
{
NSString
*
sizeKey
=
nil
;
switch
(
size
)
{
case
BUYImageURLSize100x100
:
sizeKey
=
@"_small"
;
break
;
case
BUYImageURLSize160x160
:
sizeKey
=
@"_compact"
;
break
;
case
BUYImageURLSize240x240
:
sizeKey
=
@"_medium"
;
break
;
case
BUYImageURLSize480x480
:
sizeKey
=
@"_large"
;
break
;
case
BUYImageURLSize600x600
:
sizeKey
=
@"_grande"
;
break
;
case
BUYImageURLSize1024x1024
:
sizeKey
=
@"_1024x1024"
;
break
;
case
BUYImageURLSize2048x2048
:
sizeKey
=
@"_2048x2048"
;
break
;
case
BUYImageURLSize100x100
:
return
@"_small"
;
case
BUYImageURLSize160x160
:
return
@"_compact"
;
case
BUYImageURLSize240x240
:
return
@"_medium"
;
case
BUYImageURLSize480x480
:
return
@"_large"
;
case
BUYImageURLSize600x600
:
return
@"_grande"
;
case
BUYImageURLSize1024x1024
:
return
@"_1024x1024"
;
case
BUYImageURLSize2048x2048
:
return
@"_2048x2048"
;
}
return
sizeKey
;
}
@end
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYLineItem.h
View file @
6c6a94a5
...
...
@@ -24,10 +24,13 @@
// THE SOFTWARE.
//
#import <Buy/_BUYLineItem.h>
#import <Buy/BUYModelManager.h>
#import "_BUYLineItem.h"
#import "BUYModelManager.h"
NS_ASSUME_NONNULL_BEGIN
@class
BUYCartLineItem
,
BUYProductVariant
;
@class
BUYCartLineItem
;
@class
BUYProductVariant
;
@class
BUYCartLineItem
;
@interface
BUYLineItem
:
_BUYLineItem
{}
...
...
@@ -36,11 +39,11 @@
@end
@class
BUYCartLineItem
;
@interface
BUYModelManager
(
BUYLineItemCreation
)
-
(
BUYLineItem
*
)
lineItemWithVariant
:(
BUYProductVariant
*
)
variant
;
-
(
BUYLineItem
*
)
lineItemWithCartLineItem
:(
BUYCartLineItem
*
)
cartLineItem
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOption.h
View file @
6c6a94a5
...
...
@@ -24,8 +24,11 @@
// THE SOFTWARE.
//
#import <Buy/_BUYOption.h>
#import "_BUYOption.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYOption
:
_BUYOption
{}
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOptionValue.h
View file @
6c6a94a5
...
...
@@ -24,10 +24,13 @@
// THE SOFTWARE.
//
#import <Buy/_BUYOptionValue.h>
#import "_BUYOptionValue.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYOptionValue
:
_BUYOptionValue
{}
-
(
BOOL
)
isEqualToOptionValue
:
(
BUYOptionValue
*
)
other
;
-
(
BOOL
)
isEqualToOptionValue
:
(
nullable
BUYOptionValue
*
)
other
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOrder.h
View file @
6c6a94a5
...
...
@@ -24,7 +24,8 @@
// THE SOFTWARE.
//
#import <Buy/_BUYOrder.h>
#import "_BUYOrder.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYOrder
:
_BUYOrder
{}
...
...
@@ -39,3 +40,5 @@
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYOrder.m
View file @
6c6a94a5
...
...
@@ -31,7 +31,7 @@
-
(
NSArray
<
BUYLineItem
*>
*
)
lineItemsArray
{
return
self
.
lineItems
.
array
;
return
self
.
lineItems
.
array
?:
@[]
;
}
-
(
NSArray
*
)
formatIDsForLineItemsJSON
:
(
NSArray
<
NSDictionary
*>
*
)
lineItems
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.h
View file @
6c6a94a5
...
...
@@ -24,13 +24,15 @@
// THE SOFTWARE.
//
#import <Buy/_BUYProduct.h>
#import "_BUYProduct.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYProduct
:
_BUYProduct
{}
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
createdAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
updatedAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
publishedAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSString
*
stringDescription
;
/**
...
...
@@ -70,7 +72,7 @@
*
* @return the product variant matching the set of options
*/
-
(
BUYProductVariant
*
)
variantWithOptions
:(
NSArray
*
)
options
;
-
(
nullable
BUYProductVariant
*
)
variantWithOptions
:(
NSArray
*
)
options
;
/**
* Determine if the variant is a default variant automatically created by Shopify
...
...
@@ -80,3 +82,5 @@
-
(
BOOL
)
isDefaultVariant
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.m
View file @
6c6a94a5
...
...
@@ -60,17 +60,17 @@
-
(
NSArray
<
BUYImageLink
*>
*
)
imagesArray
{
return
self
.
images
.
array
;
return
self
.
images
.
array
?:
@[]
;
}
-
(
NSArray
<
BUYOption
*>
*
)
optionsArray
{
return
self
.
options
.
array
;
return
self
.
options
.
array
?:
@[]
;
}
-
(
NSArray
<
BUYProductVariant
*>
*
)
variantsArray
{
return
self
.
variants
.
array
;
return
self
.
variants
.
array
?:
@[]
;
}
@end
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProductVariant.h
View file @
6c6a94a5
...
...
@@ -24,7 +24,8 @@
// THE SOFTWARE.
//
#import <Buy/_BUYProductVariant.h>
#import "_BUYProductVariant.h"
NS_ASSUME_NONNULL_BEGIN
@class
BUYOptionValue
;
...
...
@@ -37,7 +38,7 @@
*
* @return the option value
*/
-
(
BUYOptionValue
*
)
optionValueForName
:
(
NSString
*
)
optionName
;
-
(
nullable
BUYOptionValue
*
)
optionValueForName
:
(
NSString
*
)
optionName
;
/**
* Filters array of product variants filtered based on a selected option value
...
...
@@ -50,3 +51,5 @@
+
(
NSArray
*
)
filterProductVariants
:(
NSArray
*
)
productVariants
forOptionValue
:(
BUYOptionValue
*
)
optionValue
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYShop.h
View file @
6c6a94a5
...
...
@@ -24,8 +24,11 @@
// THE SOFTWARE.
//
#import <Buy/_BUYShop.h>
#import "_BUYShop.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYShop
:
_BUYShop
{}
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckout.h
View file @
6c6a94a5
...
...
@@ -24,15 +24,15 @@
// THE SOFTWARE.
//
#import <Buy/_BUYCheckout.h>
#import <Buy/_BUYProductVariant.h>
#import <Buy/BUYModelManager.h>
#import "_BUYCheckout.h"
#import "_BUYProductVariant.h"
#import "BUYModelManager.h"
NS_ASSUME_NONNULL_BEGIN
@class
BUYCart
,
BUYCartLineItem
,
BUYAddress
,
BUYGiftCard
;
@
interface
BUYCheckout
:
_BUYCheckout
{}
@property
(
nonatomic
,
copy
)
NSNumber
*
taxesIncluded
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
createdAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDate
*
updatedAtDate
;
@property
(
nonatomic
,
readonly
,
copy
)
NSDictionary
*
attributesDictionary
;
...
...
@@ -47,7 +47,7 @@
-
(
void
)
updateWithCart
:(
BUYCart
*
)
cart
;
-
(
BUYGiftCard
*
)
giftCardWithIdentifier
:(
NSNumber
*
)
identifier
;
-
(
nullable
BUYGiftCard
*
)
giftCardWithIdentifier
:(
NSNumber
*
)
identifier
;
-
(
void
)
addGiftCard
:(
BUYGiftCard
*
)
giftCard
;
-
(
void
)
removeGiftCardWithIdentifier
:(
NSNumber
*
)
identifier
;
...
...
@@ -61,3 +61,5 @@
-
(
BUYCheckout
*
)
checkoutwithCartToken
:(
NSString
*
)
token
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckout.m
View file @
6c6a94a5
...
...
@@ -118,12 +118,12 @@
-
(
NSArray
<
BUYGiftCard
*>
*
)
giftCardsArray
{
return
self
.
giftCards
.
array
;
return
self
.
giftCards
.
array
?:
@[]
;
}
-
(
NSArray
<
BUYCartLineItem
*>
*
)
lineItemsArray
{
return
self
.
lineItems
.
array
;
return
self
.
lineItems
.
array
?:
@[]
;
}
#pragma mark - Update -
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckoutAttribute.h
View file @
6c6a94a5
...
...
@@ -24,10 +24,14 @@
// THE SOFTWARE.
//
#import <Buy/_BUYCheckoutAttribute.h>
#import "_BUYCheckoutAttribute.h"
NS_ASSUME_NONNULL_BEGIN
/**
* A BUYCheckoutAttribute represents a checkout attributes key and value
*/
@interface
BUYCheckoutAttribute
:
_BUYCheckoutAttribute
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYDiscount.h
View file @
6c6a94a5
...
...
@@ -24,12 +24,17 @@
// THE SOFTWARE.
//
#import <Buy/_BUYDiscount.h>
#import <Buy/BUYModelManager.h>
#import "_BUYDiscount.h"
#import "BUYModelManager.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYDiscount
:
_BUYDiscount
{}
@end
@interface
BUYModelManager
(
BUYDiscountCreating
)
-
(
BUYDiscount
*
)
discountWithCode
:(
NSString
*
)
code
;
-
(
BUYDiscount
*
)
discountWithCode
:(
nullable
NSString
*
)
code
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYGiftCard.h
View file @
6c6a94a5
...
...
@@ -24,8 +24,9 @@
// THE SOFTWARE.
//
#import <Buy/_BUYGiftCard.h>
#import <Buy/BUYModelManager.h>
#import "_BUYGiftCard.h"
#import "BUYModelManager.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYGiftCard
:
_BUYGiftCard
{}
...
...
@@ -36,3 +37,5 @@
-
(
BUYGiftCard
*
)
giftCardWithCode
:(
NSString
*
)
code
;
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYMaskedCreditCard.h
View file @
6c6a94a5
...
...
@@ -24,8 +24,11 @@
// THE SOFTWARE.
//
#import <Buy/_BUYMaskedCreditCard.h>
#import "_BUYMaskedCreditCard.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYMaskedCreditCard
:
_BUYMaskedCreditCard
{}
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYShippingRate.h
View file @
6c6a94a5
...
...
@@ -24,8 +24,11 @@
// THE SOFTWARE.
//
#import <Buy/_BUYShippingRate.h>
#import "_BUYShippingRate.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYShippingRate
:
_BUYShippingRate
{}
@end
NS_ASSUME_NONNULL_END
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYTaxLine.h
View file @
6c6a94a5
...
...
@@ -24,8 +24,11 @@
// THE SOFTWARE.
//
#import <Buy/_BUYTaxLine.h>
#import "_BUYTaxLine.h"
NS_ASSUME_NONNULL_BEGIN
@interface
BUYTaxLine
:
_BUYTaxLine
{}
@end
NS_ASSUME_NONNULL_END
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