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
d40187b7
Commit
d40187b7
authored
Apr 14, 2016
by
Brent Gulanowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add BUYManagedObject and BUYModelManager classes.
parent
1fe081e5
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
393 additions
and
0 deletions
+393
-0
project.pbxproj
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
+24
-0
Buy.h
Mobile Buy SDK/Mobile Buy SDK/Buy.h
+2
-0
BUYManagedObject.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYManagedObject.h
+66
-0
BUYManagedObject.m
Mobile Buy SDK/Mobile Buy SDK/Models/BUYManagedObject.m
+115
-0
BUYModelManager.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYModelManager.h
+58
-0
BUYModelManager.m
Mobile Buy SDK/Mobile Buy SDK/Models/BUYModelManager.m
+126
-0
Buy.h
Mobile Buy SDK/Mobile Buy SDK/Static Framework/Buy.h
+2
-0
No files found.
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
View file @
d40187b7
...
@@ -127,6 +127,14 @@
...
@@ -127,6 +127,14 @@
84D915441CC0359700D334FB
/* BUYObserver.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915411CC0359700D334FB
/* BUYObserver.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
84D915441CC0359700D334FB
/* BUYObserver.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915411CC0359700D334FB
/* BUYObserver.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
84D915451CC0359700D334FB
/* BUYObserver.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915421CC0359700D334FB
/* BUYObserver.m */
;
};
84D915451CC0359700D334FB
/* BUYObserver.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915421CC0359700D334FB
/* BUYObserver.m */
;
};
84D915461CC0359700D334FB
/* BUYObserver.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915421CC0359700D334FB
/* BUYObserver.m */
;
};
84D915461CC0359700D334FB
/* BUYObserver.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915421CC0359700D334FB
/* BUYObserver.m */
;
};
84D9154B1CC03F1600D334FB
/* BUYManagedObject.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915471CC03F1600D334FB
/* BUYManagedObject.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
84D9154C1CC03F1600D334FB
/* BUYManagedObject.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915471CC03F1600D334FB
/* BUYManagedObject.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
84D9154D1CC03F1600D334FB
/* BUYManagedObject.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915481CC03F1600D334FB
/* BUYManagedObject.m */
;
};
84D9154E1CC03F1600D334FB
/* BUYManagedObject.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915481CC03F1600D334FB
/* BUYManagedObject.m */
;
};
84D9154F1CC03F1600D334FB
/* BUYModelManager.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915491CC03F1600D334FB
/* BUYModelManager.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
84D915501CC03F1600D334FB
/* BUYModelManager.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D915491CC03F1600D334FB
/* BUYModelManager.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
84D915511CC03F1600D334FB
/* BUYModelManager.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D9154A1CC03F1600D334FB
/* BUYModelManager.m */
;
};
84D915521CC03F1600D334FB
/* BUYModelManager.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84D9154A1CC03F1600D334FB
/* BUYModelManager.m */
;
};
9003969B1B601DF400226B73
/* BUYCartLineItem.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
900396991B601DF400226B73
/* BUYCartLineItem.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9003969B1B601DF400226B73
/* BUYCartLineItem.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
900396991B601DF400226B73
/* BUYCartLineItem.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9003969C1B601DF400226B73
/* BUYCartLineItem.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9003969A1B601DF400226B73
/* BUYCartLineItem.m */
;
};
9003969C1B601DF400226B73
/* BUYCartLineItem.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9003969A1B601DF400226B73
/* BUYCartLineItem.m */
;
};
900396AC1B627CB900226B73
/* BUYProductView.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
900396AA1B627CB900226B73
/* BUYProductView.h */
;
};
900396AC1B627CB900226B73
/* BUYProductView.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
900396AA1B627CB900226B73
/* BUYProductView.h */
;
};
...
@@ -477,6 +485,10 @@
...
@@ -477,6 +485,10 @@
849810911CB7E07900CFAB58
/* BUYFlatCollectionTransformer.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYFlatCollectionTransformer.m
;
sourceTree
=
"<group>"
;
};
849810911CB7E07900CFAB58
/* BUYFlatCollectionTransformer.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYFlatCollectionTransformer.m
;
sourceTree
=
"<group>"
;
};
84D915411CC0359700D334FB
/* BUYObserver.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYObserver.h
;
sourceTree
=
"<group>"
;
};
84D915411CC0359700D334FB
/* BUYObserver.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYObserver.h
;
sourceTree
=
"<group>"
;
};
84D915421CC0359700D334FB
/* BUYObserver.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYObserver.m
;
sourceTree
=
"<group>"
;
};
84D915421CC0359700D334FB
/* BUYObserver.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYObserver.m
;
sourceTree
=
"<group>"
;
};
84D915471CC03F1600D334FB
/* BUYManagedObject.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYManagedObject.h
;
sourceTree
=
"<group>"
;
};
84D915481CC03F1600D334FB
/* BUYManagedObject.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYManagedObject.m
;
sourceTree
=
"<group>"
;
};
84D915491CC03F1600D334FB
/* BUYModelManager.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYModelManager.h
;
sourceTree
=
"<group>"
;
};
84D9154A1CC03F1600D334FB
/* BUYModelManager.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYModelManager.m
;
sourceTree
=
"<group>"
;
};
900396991B601DF400226B73
/* BUYCartLineItem.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYCartLineItem.h
;
sourceTree
=
"<group>"
;
};
900396991B601DF400226B73
/* BUYCartLineItem.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYCartLineItem.h
;
sourceTree
=
"<group>"
;
};
9003969A1B601DF400226B73
/* BUYCartLineItem.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYCartLineItem.m
;
sourceTree
=
"<group>"
;
};
9003969A1B601DF400226B73
/* BUYCartLineItem.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYCartLineItem.m
;
sourceTree
=
"<group>"
;
};
900396AA1B627CB900226B73
/* BUYProductView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
lineEnding
=
0
;
name
=
BUYProductView.h
;
path
=
"Product View/BUYProductView.h"
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
900396AA1B627CB900226B73
/* BUYProductView.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
lineEnding
=
0
;
name
=
BUYProductView.h
;
path
=
"Product View/BUYProductView.h"
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
...
@@ -980,6 +992,10 @@
...
@@ -980,6 +992,10 @@
F77374AB19C796BD0039681C
/* BUYCreditCard.m */
,
F77374AB19C796BD0039681C
/* BUYCreditCard.m */
,
BE47340D1B66C4EF00AA721A
/* BUYError.h */
,
BE47340D1B66C4EF00AA721A
/* BUYError.h */
,
BE47340E1B66C4EF00AA721A
/* BUYError.m */
,
BE47340E1B66C4EF00AA721A
/* BUYError.m */
,
84D915471CC03F1600D334FB
/* BUYManagedObject.h */
,
84D915481CC03F1600D334FB
/* BUYManagedObject.m */
,
84D915491CC03F1600D334FB
/* BUYModelManager.h */
,
84D9154A1CC03F1600D334FB
/* BUYModelManager.m */
,
2AF52A931A7010B20087DB2C
/* BUYObject.h */
,
2AF52A931A7010B20087DB2C
/* BUYObject.h */
,
2AF52A941A7010B20087DB2C
/* BUYObject.m */
,
2AF52A941A7010B20087DB2C
/* BUYObject.m */
,
84D915411CC0359700D334FB
/* BUYObserver.h */
,
84D915411CC0359700D334FB
/* BUYObserver.h */
,
...
@@ -1116,6 +1132,7 @@
...
@@ -1116,6 +1132,7 @@
901931501BC5B9BC00D1134E
/* BUYOrder.h in Headers */
,
901931501BC5B9BC00D1134E
/* BUYOrder.h in Headers */
,
901931531BC5B9BC00D1134E
/* BUYOptionSelectionNavigationController.h in Headers */
,
901931531BC5B9BC00D1134E
/* BUYOptionSelectionNavigationController.h in Headers */
,
901931541BC5B9BC00D1134E
/* BUYPresentationControllerWithNavigationController.h in Headers */
,
901931541BC5B9BC00D1134E
/* BUYPresentationControllerWithNavigationController.h in Headers */
,
84D9154C1CC03F1600D334FB
/* BUYManagedObject.h in Headers */
,
901931551BC5B9BC00D1134E
/* BUYPresentationControllerForVariantSelection.h in Headers */
,
901931551BC5B9BC00D1134E
/* BUYPresentationControllerForVariantSelection.h in Headers */
,
901931571BC5B9BC00D1134E
/* BUYObject.h in Headers */
,
901931571BC5B9BC00D1134E
/* BUYObject.h in Headers */
,
901931581BC5B9BC00D1134E
/* BUYRuntime.h in Headers */
,
901931581BC5B9BC00D1134E
/* BUYRuntime.h in Headers */
,
...
@@ -1125,6 +1142,7 @@
...
@@ -1125,6 +1142,7 @@
84980F5F1CB7617E00CFAB58
/* BUYDateTransformer.h in Headers */
,
84980F5F1CB7617E00CFAB58
/* BUYDateTransformer.h in Headers */
,
84980F591CB7617500CFAB58
/* BUYURLTransformer.h in Headers */
,
84980F591CB7617500CFAB58
/* BUYURLTransformer.h in Headers */
,
9019315B1BC5B9BC00D1134E
/* BUYImageKit.h in Headers */
,
9019315B1BC5B9BC00D1134E
/* BUYImageKit.h in Headers */
,
84D915501CC03F1600D334FB
/* BUYModelManager.h in Headers */
,
9019315C1BC5B9BC00D1134E
/* BUYCollection+Additions.h in Headers */
,
9019315C1BC5B9BC00D1134E
/* BUYCollection+Additions.h in Headers */
,
9032F2DB1BE9457A00BB9EEF
/* BUYCheckoutAttribute.h in Headers */
,
9032F2DB1BE9457A00BB9EEF
/* BUYCheckoutAttribute.h in Headers */
,
9019315E1BC5B9BC00D1134E
/* BUYError.h in Headers */
,
9019315E1BC5B9BC00D1134E
/* BUYError.h in Headers */
,
...
@@ -1206,6 +1224,7 @@
...
@@ -1206,6 +1224,7 @@
90E83BC41B9F550E00C95A1B
/* BUYOrder.h in Headers */
,
90E83BC41B9F550E00C95A1B
/* BUYOrder.h in Headers */
,
BEB74A281B554BFB0005A300
/* BUYOptionSelectionNavigationController.h in Headers */
,
BEB74A281B554BFB0005A300
/* BUYOptionSelectionNavigationController.h in Headers */
,
BEB74A691B5564160005A300
/* BUYPresentationControllerWithNavigationController.h in Headers */
,
BEB74A691B5564160005A300
/* BUYPresentationControllerWithNavigationController.h in Headers */
,
84D9154B1CC03F1600D334FB
/* BUYManagedObject.h in Headers */
,
BEB74A221B554BF20005A300
/* BUYPresentationControllerForVariantSelection.h in Headers */
,
BEB74A221B554BF20005A300
/* BUYPresentationControllerForVariantSelection.h in Headers */
,
BE9A645D1B503CE30033E558
/* BUYObject.h in Headers */
,
BE9A645D1B503CE30033E558
/* BUYObject.h in Headers */
,
BE9A646E1B503D1E0033E558
/* BUYRuntime.h in Headers */
,
BE9A646E1B503D1E0033E558
/* BUYRuntime.h in Headers */
,
...
@@ -1215,6 +1234,7 @@
...
@@ -1215,6 +1234,7 @@
84980F5E1CB7617E00CFAB58
/* BUYDateTransformer.h in Headers */
,
84980F5E1CB7617E00CFAB58
/* BUYDateTransformer.h in Headers */
,
84980F581CB7617500CFAB58
/* BUYURLTransformer.h in Headers */
,
84980F581CB7617500CFAB58
/* BUYURLTransformer.h in Headers */
,
900E7C841B5DA553006F3C81
/* BUYImageKit.h in Headers */
,
900E7C841B5DA553006F3C81
/* BUYImageKit.h in Headers */
,
84D9154F1CC03F1600D334FB
/* BUYModelManager.h in Headers */
,
900396F61B69563400226B73
/* BUYCollection+Additions.h in Headers */
,
900396F61B69563400226B73
/* BUYCollection+Additions.h in Headers */
,
9032F2DA1BE9457A00BB9EEF
/* BUYCheckoutAttribute.h in Headers */
,
9032F2DA1BE9457A00BB9EEF
/* BUYCheckoutAttribute.h in Headers */
,
BE47340F1B66C4EF00AA721A
/* BUYError.h in Headers */
,
BE47340F1B66C4EF00AA721A
/* BUYError.h in Headers */
,
...
@@ -1407,6 +1427,7 @@
...
@@ -1407,6 +1427,7 @@
84980F611CB7617E00CFAB58
/* BUYDateTransformer.m in Sources */
,
84980F611CB7617E00CFAB58
/* BUYDateTransformer.m in Sources */
,
901930E81BC5B9BC00D1134E
/* BUYImageLink.m in Sources */
,
901930E81BC5B9BC00D1134E
/* BUYImageLink.m in Sources */
,
901930E91BC5B9BC00D1134E
/* BUYProductVariant.m in Sources */
,
901930E91BC5B9BC00D1134E
/* BUYProductVariant.m in Sources */
,
84D9154E1CC03F1600D334FB
/* BUYManagedObject.m in Sources */
,
901930EA1BC5B9BC00D1134E
/* BUYProductViewController.m in Sources */
,
901930EA1BC5B9BC00D1134E
/* BUYProductViewController.m in Sources */
,
841ADE021CB6C942000004B0
/* NSArray+BUYAdditions.m in Sources */
,
841ADE021CB6C942000004B0
/* NSArray+BUYAdditions.m in Sources */
,
901930EC1BC5B9BC00D1134E
/* BUYError.m in Sources */
,
901930EC1BC5B9BC00D1134E
/* BUYError.m in Sources */
,
...
@@ -1443,6 +1464,7 @@
...
@@ -1443,6 +1464,7 @@
901931081BC5B9BC00D1134E
/* BUYRuntime.m in Sources */
,
901931081BC5B9BC00D1134E
/* BUYRuntime.m in Sources */
,
901931091BC5B9BC00D1134E
/* BUYCart.m in Sources */
,
901931091BC5B9BC00D1134E
/* BUYCart.m in Sources */
,
9019310A1BC5B9BC00D1134E
/* BUYPaymentButton.m in Sources */
,
9019310A1BC5B9BC00D1134E
/* BUYPaymentButton.m in Sources */
,
84D915521CC03F1600D334FB
/* BUYModelManager.m in Sources */
,
841ADE121CB6C942000004B0
/* NSDictionary+BUYAdditions.m in Sources */
,
841ADE121CB6C942000004B0
/* NSDictionary+BUYAdditions.m in Sources */
,
9019310B1BC5B9BC00D1134E
/* BUYProduct+Options.m in Sources */
,
9019310B1BC5B9BC00D1134E
/* BUYProduct+Options.m in Sources */
,
9019310C1BC5B9BC00D1134E
/* BUYGiftCard.m in Sources */
,
9019310C1BC5B9BC00D1134E
/* BUYGiftCard.m in Sources */
,
...
@@ -1523,6 +1545,7 @@
...
@@ -1523,6 +1545,7 @@
84980F601CB7617E00CFAB58
/* BUYDateTransformer.m in Sources */
,
84980F601CB7617E00CFAB58
/* BUYDateTransformer.m in Sources */
,
BE9A645A1B503CD90033E558
/* BUYImageLink.m in Sources */
,
BE9A645A1B503CD90033E558
/* BUYImageLink.m in Sources */
,
BE9A64641B503CFB0033E558
/* BUYProductVariant.m in Sources */
,
BE9A64641B503CFB0033E558
/* BUYProductVariant.m in Sources */
,
84D9154D1CC03F1600D334FB
/* BUYManagedObject.m in Sources */
,
BEB74A2E1B554E8B0005A300
/* BUYProductViewController.m in Sources */
,
BEB74A2E1B554E8B0005A300
/* BUYProductViewController.m in Sources */
,
841ADE011CB6C942000004B0
/* NSArray+BUYAdditions.m in Sources */
,
841ADE011CB6C942000004B0
/* NSArray+BUYAdditions.m in Sources */
,
BE4734101B66C4EF00AA721A
/* BUYError.m in Sources */
,
BE4734101B66C4EF00AA721A
/* BUYError.m in Sources */
,
...
@@ -1559,6 +1582,7 @@
...
@@ -1559,6 +1582,7 @@
BE9A646F1B503D210033E558
/* BUYRuntime.m in Sources */
,
BE9A646F1B503D210033E558
/* BUYRuntime.m in Sources */
,
BE9A644A1B503C980033E558
/* BUYCart.m in Sources */
,
BE9A644A1B503C980033E558
/* BUYCart.m in Sources */
,
BE9A64831B503DB10033E558
/* BUYPaymentButton.m in Sources */
,
BE9A64831B503DB10033E558
/* BUYPaymentButton.m in Sources */
,
84D915511CC03F1600D334FB
/* BUYModelManager.m in Sources */
,
841ADE111CB6C942000004B0
/* NSDictionary+BUYAdditions.m in Sources */
,
841ADE111CB6C942000004B0
/* NSDictionary+BUYAdditions.m in Sources */
,
BE9A646B1B503D140033E558
/* BUYProduct+Options.m in Sources */
,
BE9A646B1B503D140033E558
/* BUYProduct+Options.m in Sources */
,
BE9A64581B503CD10033E558
/* BUYGiftCard.m in Sources */
,
BE9A64581B503CD10033E558
/* BUYGiftCard.m in Sources */
,
...
...
Mobile Buy SDK/Mobile Buy SDK/Buy.h
View file @
d40187b7
...
@@ -57,6 +57,8 @@ FOUNDATION_EXPORT const unsigned char BuyVersionString[];
...
@@ -57,6 +57,8 @@ FOUNDATION_EXPORT const unsigned char BuyVersionString[];
#import <Buy/BUYApplePayHelpers.h>
#import <Buy/BUYApplePayHelpers.h>
#import <Buy/BUYClient.h>
#import <Buy/BUYClient.h>
#import <Buy/BUYError.h>
#import <Buy/BUYError.h>
#import <Buy/BUYManagedObject.h>
#import <Buy/BUYModelManager.h>
#import <Buy/BUYModelManagerProtocol.h>
#import <Buy/BUYModelManagerProtocol.h>
#import <Buy/BUYObjectProtocol.h>
#import <Buy/BUYObjectProtocol.h>
#import <Buy/BUYObserver.h>
#import <Buy/BUYObserver.h>
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/BUYManagedObject.h
0 → 100644
View file @
d40187b7
//
// BUYManagedObject.h
// Mobile Buy SDK
//
// Created by Shopify.
// Copyright (c) 2015 Shopify Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import <CoreData/CoreData.h>
#import <Buy/BUYObject.h>
#if defined CORE_DATA_PERSISTENCE
#define BUYCachedObject BUYManagedObject
/**
* This is the base class for all Shopify persistent model objects.
* This class takes care of convertion .json responses into
* the associated subclass.
*
* You will generally not need to interact with this class directly.
*/
@interface
BUYManagedObject
:
NSManagedObject
<
BUYObject
>
-
(
nonnull
instancetype
)
init
NS_UNAVAILABLE
;
@end
#else
#define BUYCachedObject BUYObject
/**
* Key-value coding API defined in NSManagedObject which is used by mogenerator generated accessors.
* When persistence is not implemented, will/didAccess do nothing; primitive KVC maps to normal KVC.
*/
@interface
BUYObject
(
BUYManagedObjectConformance
)
-
(
void
)
willAccessValueForKey
:(
nonnull
NSString
*
)
key
;
-
(
void
)
didAccessValueForKey
:(
nonnull
NSString
*
)
key
;
-
(
nullable
id
)
primitiveValueForKey
:(
nonnull
NSString
*
)
key
;
-
(
void
)
setPrimitiveValue
:(
nullable
id
)
value
forKey
:(
nonnull
NSString
*
)
key
;
@end
#endif
Mobile Buy SDK/Mobile Buy SDK/Models/BUYManagedObject.m
0 → 100644
View file @
d40187b7
//
// BUYManagedObject.m
// Mobile Buy SDK
//
// Created by Shopify.
// Copyright (c) 2015 Shopify Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import "BUYManagedObject.h"
#import "NSDictionary+BUYAdditions.h"
#import "NSException+BUYAdditions.h"
#import "NSEntityDescription+BUYAdditions.h"
#import "NSPropertyDescription+BUYAdditions.h"
#import <CoreData/CoreData.h>
#if defined CORE_DATA_PERSISTENCE
@interface
NSManagedObjectContext
(
BUYPersistence
)
@property
(
nonatomic
,
strong
)
BUYModelManager
*
modelManager
;
@end
@implementation
BUYManagedObject
-
(
NSDictionary
*
)
JSONEncodedProperties
{
return
self
.
entity
.
JSONEncodedProperties
;
}
+
(
BOOL
)
isPersistentClass
{
return
YES
;
}
+
(
BOOL
)
tracksDirtyProperties
{
return
NO
;
}
+
(
NSPredicate
*
)
fetchPredicateWithJSON
:
(
NSDictionary
*
)
JSONDictionary
{
return
JSONDictionary
[
@"id"
]
?
[
NSPredicate
predicateWithFormat
:
@"identifier = %@"
,
JSONDictionary
[
@"id"
]]
:
nil
;
}
+
(
NSString
*
)
entityName
{
@throw
BUYAbstractMethod
();
}
-
(
BUYModelManager
*
)
modelManager
{
return
self
.
managedObjectContext
.
modelManager
;
}
-
(
NSDictionary
*
)
JSONDictionary
{
// JSON generation starts in `-buy_JSONForObject`.
// Both persistent and transient objects go through this interface.
return
[
self
.
entity
buy_JSONForObject
:
self
];
}
-
(
void
)
setJSONDictionary
:
(
NSDictionary
*
)
JSONDictionary
{
// JSON parsing starts in `-buy_updateObject:withJSON:`.
// Both persistent and transient objects go through this interface.
[
self
.
entity
buy_updateObject
:
self
withJSON
:
JSONDictionary
];
}
-
(
NSDictionary
*
)
jsonDictionaryForCheckout
{
return
self
.
JSONDictionary
;
}
@end
#else
@implementation
BUYObject
(
BUYManagedObjectConformance
)
-
(
void
)
willAccessValueForKey
:(
NSString
*
)
key
{}
-
(
void
)
didAccessValueForKey
:(
NSString
*
)
key
{}
-
(
id
)
primitiveValueForKey
:(
NSString
*
)
key
{
return
[
self
valueForKey
:
key
];
}
-
(
void
)
setPrimitiveValue
:(
id
)
value
forKey
:(
NSString
*
)
key
{
[
self
setValue
:
value
forKey
:
key
];
}
@end
#endif
Mobile Buy SDK/Mobile Buy SDK/Models/BUYModelManager.h
0 → 100644
View file @
d40187b7
//
// BUYModelManager.h
// Mobile Buy SDK
//
// Created by Shopify.
// Copyright (c) 2015 Shopify Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import <Foundation/Foundation.h>
#import <Buy/BUYObject.h>
#import <Buy/BUYModelManagerProtocol.h>
/**
* A basic implementation of the BUYModelManager interface that does no caching. New objects are created using alloc/init.
* Provides empty implementations of all the caching methods.
*/
@interface
BUYModelManager
:
NSObject
<
BUYModelManager
>
/**
* The managed object model describes all the model entities. See the Core Data documentation for more details.
*/
@property
(
nonatomic
,
strong
,
readonly
)
NSManagedObjectModel
*
model
;
-
(
instancetype
)
init
NS_UNAVAILABLE
;
/**
*
* @param model The Core Data managed object model for your given model. Should be the Buy model.
*
* @return A new model manager object.
*/
-
(
instancetype
)
initWithModel
:(
NSManagedObjectModel
*
)
model
NS_DESIGNATED_INITIALIZER
;
/**
* Convenience initializer. Instantiates a model using the -mergedModelFromBundles: method and the Buy.framework as the bundle.
*/
+
(
instancetype
)
modelManager
;
@end
Mobile Buy SDK/Mobile Buy SDK/Models/BUYModelManager.m
0 → 100644
View file @
d40187b7
//
// BUYModelManager.m
// Mobile Buy SDK
//
// Created by Shopify.
// Copyright (c) 2015 Shopify Inc. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
//
#import "BUYModelManager.h"
#import "BUYDateTransformer.h"
#import "BUYDeliveryRangeTransformer.h"
#import "BUYFlatCollectionTransformer.h"
#import "NSArray+BUYAdditions.h"
#import "NSEntityDescription+BUYAdditions.h"
#import "NSPropertyDescription+BUYAdditions.h"
// Custom value transformer names
NSString
*
const
BUYPublicationsDateTransformerName
=
@"BUYPublicationsDate"
;
// Structured value transformer names
NSString
*
const
BUYDeliveryRangeTransformerName
=
@"BUYDeliveryRange"
;
NSString
*
const
BUYFlatArrayTransformerName
=
@"BUYFlatArray"
;
NSString
*
const
BUYProductTagsTransformerName
=
@"BUYProductTags"
;
NSString
*
const
BUYPublicationsDateFormat
=
@"yyyy-MM-dd'T'HH:mm:ssZ"
;
@interface
BUYModelManager
()
@property
(
nonatomic
,
strong
)
NSManagedObjectModel
*
model
;
@end
@implementation
BUYModelManager
+
(
void
)
initialize
{
static
dispatch_once_t
onceToken
;
dispatch_once
(
&
onceToken
,
^
{
// specialty type transformers
[
NSValueTransformer
setValueTransformer
:[
BUYDateTransformer
dateTransformerWithFormat
:
BUYPublicationsDateFormat
]
forName
:
BUYPublicationsDateTransformerName
];
// specialty collection transformers
[
NSValueTransformer
setValueTransformer
:[[
BUYDeliveryRangeTransformer
alloc
]
init
]
forName
:
BUYDeliveryRangeTransformerName
];
[
NSValueTransformer
setValueTransformer
:[
BUYFlatCollectionTransformer
arrayTransformer
]
forName
:
BUYFlatArrayTransformerName
];
[
NSValueTransformer
setValueTransformer
:[
BUYFlatCollectionTransformer
setTransformerWithSeparator
:
@", "
]
forName
:
BUYProductTagsTransformerName
];
});
}
-
(
instancetype
)
initWithModel
:
(
NSManagedObjectModel
*
)
model
{
self
=
[
super
init
];
if
(
self
)
{
self
.
model
=
model
;
}
return
self
;
}
+
(
instancetype
)
modelManager
{
return
[[
self
alloc
]
initWithModel
:[
NSManagedObjectModel
mergedModelFromBundles
:@[[
NSBundle
bundleForClass
:[
BUYObject
class
]]]]];
}
-
(
NSEntityDescription
*
)
buy_entityWithName
:
(
NSString
*
)
entityName
{
return
[
self
.
model
entitiesByName
][
entityName
];
}
-
(
id
<
BUYObject
>
)
buy_objectWithEntityName
:
(
NSString
*
)
entityName
JSONDictionary
:
(
NSDictionary
*
)
JSON
{
NSEntityDescription
*
entity
=
[
self
buy_entityWithName
:
entityName
];
Class
cls
=
entity
.
managedObjectClass
;
return
[[
cls
alloc
]
initWithModelManager
:
self
JSONDictionary
:
JSON
];
}
-
(
NSArray
<
id
<
BUYObject
>>
*
)
buy_objectsWithEntityName
:
(
NSString
*
)
entityName
JSONArray
:
(
NSArray
*
)
JSON
{
NSEntityDescription
*
entity
=
[
self
.
model
entitiesByName
][
entityName
];
Class
cls
=
entity
.
managedObjectClass
;
return
[
JSON
buy_map
:
^
id
(
NSDictionary
*
JSONDictionary
)
{
return
[[
cls
alloc
]
initWithModelManager
:
self
JSONDictionary
:
JSONDictionary
];
}];
}
-
(
id
<
BUYObject
>
)
buy_objectWithEntityName
:
(
NSString
*
)
entityName
identifier
:
(
NSNumber
*
)
identifier
{
return
nil
;
}
-
(
NSArray
<
id
<
BUYObject
>>
*
)
buy_objectsWithEntityName
:
(
NSString
*
)
entityName
identifiers
:
(
NSArray
*
)
identifiers
{
return
@[];
}
-
(
BOOL
)
buy_purgeObject
:
(
id
<
BUYObject
>
)
object
error
:
(
NSError
*
__autoreleasing
*
)
error
{
return
YES
;
}
-
(
void
)
buy_refreshCacheForObject
:
(
id
<
BUYObject
>
)
object
{
}
-
(
BOOL
)
buy_purgeObjectsWithEntityName
:
(
NSString
*
)
entityName
matchingPredicate
:
(
NSPredicate
*
)
predicate
{
return
YES
;
}
@end
Mobile Buy SDK/Mobile Buy SDK/Static Framework/Buy.h
View file @
d40187b7
...
@@ -53,6 +53,8 @@
...
@@ -53,6 +53,8 @@
#import "BUYApplePayHelpers.h"
#import "BUYApplePayHelpers.h"
#import "BUYClient.h"
#import "BUYClient.h"
#import "BUYError.h"
#import "BUYError.h"
#import "BUYManagedObject.h"
#import "BUYModelManager.h"
#import "BUYModelManagerProtocol.h"
#import "BUYModelManagerProtocol.h"
#import "BUYObjectProtocol.h"
#import "BUYObjectProtocol.h"
#import "BUYObserver.h"
#import "BUYObserver.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