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
93460a07
Commit
93460a07
authored
May 06, 2016
by
Brent Gulanowski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #122 from Shopify/task/model-management
Add support for managed models
parents
922d7a64
05cc85b4
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
1802 additions
and
338 deletions
+1802
-338
BUYObjectTests.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYObjectTests.m
+2
-4
BUYObserverTests.m
Mobile Buy SDK/Mobile Buy SDK Tests/BUYObserverTests.m
+76
-0
project.pbxproj
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
+62
-24
NSDecimalNumber+BUYAdditions.m
...K/Mobile Buy SDK/Additions/NSDecimalNumber+BUYAdditions.m
+1
-6
Buy.h
Mobile Buy SDK/Mobile Buy SDK/Buy.h
+8
-3
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
+56
-0
BUYModelManager.m
Mobile Buy SDK/Mobile Buy SDK/Models/BUYModelManager.m
+131
-0
BUYModelManagerProtocol.h
...e Buy SDK/Mobile Buy SDK/Models/BUYModelManagerProtocol.h
+2
-0
BUYObject.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObject.h
+3
-2
BUYObject.m
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObject.m
+222
-0
BUYObject.mm
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObject.mm
+0
-265
BUYObserver.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObserver.h
+43
-0
BUYObserver.m
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObserver.m
+129
-0
BUYSerializable.h
Mobile Buy SDK/Mobile Buy SDK/Models/BUYSerializable.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
BUYShop.m
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYShop.m
+0
-7
human.h.motemplate
...le Buy SDK/Models/Templates/Persistent/human.h.motemplate
+31
-0
human.m.motemplate
...le Buy SDK/Models/Templates/Persistent/human.m.motemplate
+31
-0
machine.h.motemplate
... Buy SDK/Models/Templates/Persistent/machine.h.motemplate
+180
-0
machine.m.motemplate
... Buy SDK/Models/Templates/Persistent/machine.m.motemplate
+176
-0
human.h.motemplate
...ile Buy SDK/Models/Templates/Transient/human.h.motemplate
+31
-0
human.m.motemplate
...ile Buy SDK/Models/Templates/Transient/human.m.motemplate
+31
-0
machine.h.motemplate
...e Buy SDK/Models/Templates/Transient/machine.h.motemplate
+167
-0
machine.m.motemplate
...e Buy SDK/Models/Templates/Transient/machine.m.motemplate
+209
-0
BUYCheckout.m
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckout.m
+2
-4
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
+6
-1
mogenerator
Scripts/mogenerator
+0
-0
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYObjectTests.m
View file @
93460a07
...
...
@@ -175,11 +175,9 @@
@implementation
BUYDirtyTracked
+
(
void
)
initialize
+
(
BOOL
)
tracksDirtyProperties
{
if
(
self
==
[
BUYDirtyTracked
class
])
{
[
self
trackDirtyProperties
];
}
return
YES
;
}
@end
...
...
Mobile Buy SDK/Mobile Buy SDK Tests/BUYObserverTests.m
0 → 100644
View file @
93460a07
//
// BUYObserverTests.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 <XCTest/XCTest.h>
#import "BUYObserver.h"
@interface
Target
:
NSObject
@property
(
nonatomic
)
NSString
*
name
;
@property
(
nonatomic
)
NSNumber
*
number
;
@property
(
nonatomic
)
NSDate
*
date
;
@end
@implementation
Target
@end
@interface
BUYObserverTests
:
XCTestCase
@end
@implementation
BUYObserverTests
-
(
void
)
test
{
NSArray
*
properties
=
@[
@"name"
,
@"number"
,
@"date"
];
Target
*
target
=
[[
Target
alloc
]
init
];
BUYObserver
*
observer
=
[
BUYObserver
observeProperties
:
properties
ofObject
:
target
];
XCTAssertEqualObjects
(
observer
.
observedProperties
,
properties
);
XCTAssertEqualObjects
(
observer
.
changedProperties
,
[
NSSet
set
]);
target
.
name
=
@"Name"
;
XCTAssertEqualObjects
(
observer
.
changedProperties
,
[
NSSet
setWithObject
:
@"name"
]);
target
.
number
=
@10
;
target
.
date
=
[
NSDate
date
];
NSSet
*
expected
=
[
NSSet
setWithObjects
:
@"name"
,
@"number"
,
@"date"
,
nil
];
XCTAssertEqualObjects
(
observer
.
changedProperties
,
expected
);
[
observer
reset
];
XCTAssertEqualObjects
(
observer
.
changedProperties
,
[
NSSet
set
]);
__weak
Target
*
weakTarget
=
target
;
[
observer
cancel
];
XCTAssertEqualObjects
(
observer
.
changedProperties
,
nil
);
XCTAssertEqualObjects
(
observer
.
object
,
nil
);
target
=
nil
;
XCTAssertEqual
(
weakTarget
,
nil
);
}
@end
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
View file @
93460a07
...
...
@@ -80,12 +80,12 @@
8491103A1CCE718100E53B93
/* BUYExceptionAdditionsTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
849110391CCE718100E53B93
/* BUYExceptionAdditionsTests.m */
;
};
8491103C1CCE731900E53B93
/* BUYURLAdditionsTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8491103B1CCE731900E53B93
/* BUYURLAdditionsTests.m */
;
};
8491103E1CCE988600E53B93
/* BUYFontAdditionsTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8491103D1CCE988600E53B93
/* BUYFontAdditionsTests.m */
;
};
849110401CCE9DFB00E53B93
/* BUYCoreDataModelAdditionsTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
8491103F1CCE9DFB00E53B93
/* BUYCoreDataModelAdditionsTests.m */
;
};
849110441CCE9F3F00E53B93
/* BUYTransformerTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
849110431CCE9F3F00E53B93
/* BUYTransformerTests.m */
;
};
84980F291CB75AC200CFAB58
/* BUYObjectProtocol.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84980F281CB75AC200CFAB58
/* BUYObjectProtocol.h */
;
};
84980F2A1CB75AC200CFAB58
/* BUYObjectProtocol.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84980F281CB75AC200CFAB58
/* BUYObjectProtocol.h */
;
};
84980F2C1CB75B5E00CFAB58
/* BUYModelManagerProtocol.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84980F2B1CB75B5E00CFAB58
/* BUYModelManagerProtocol.h */
;
};
84980F2D1CB75B5E00CFAB58
/* BUYModelManagerProtocol.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84980F2B1CB75B5E00CFAB58
/* BUYModelManagerProtocol.h */
;
};
8491104A1CCEA85C00E53B93
/* BUYObserverTests.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
849110461CCEA85C00E53B93
/* BUYObserverTests.m */
;
};
84980F291CB75AC200CFAB58
/* BUYObjectProtocol.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84980F281CB75AC200CFAB58
/* BUYObjectProtocol.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
84980F2A1CB75AC200CFAB58
/* BUYObjectProtocol.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84980F281CB75AC200CFAB58
/* BUYObjectProtocol.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
84980F2C1CB75B5E00CFAB58
/* BUYModelManagerProtocol.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84980F2B1CB75B5E00CFAB58
/* BUYModelManagerProtocol.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
84980F2D1CB75B5E00CFAB58
/* BUYModelManagerProtocol.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84980F2B1CB75B5E00CFAB58
/* BUYModelManagerProtocol.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
84980F321CB75C2900CFAB58
/* NSEntityDescription+BUYAdditions.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84980F2E1CB75C2900CFAB58
/* NSEntityDescription+BUYAdditions.h */
;
};
84980F331CB75C2900CFAB58
/* NSEntityDescription+BUYAdditions.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84980F2E1CB75C2900CFAB58
/* NSEntityDescription+BUYAdditions.h */
;
};
84980F341CB75C2900CFAB58
/* NSEntityDescription+BUYAdditions.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84980F2F1CB75C2900CFAB58
/* NSEntityDescription+BUYAdditions.m */
;
};
...
...
@@ -120,6 +120,18 @@
849810991CB7E07900CFAB58
/* BUYFlatCollectionTransformer.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
849810911CB7E07900CFAB58
/* BUYFlatCollectionTransformer.m */
;
};
84CA59BC1CD1378100B2A956
/* BUYTestModel.xcdatamodeld in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84CA59BA1CD1378100B2A956
/* BUYTestModel.xcdatamodeld */
;
};
84CA59C01CD1609400B2A956
/* TestModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
84CA59BF1CD1609400B2A956
/* TestModel.m */
;
};
84D915431CC0359700D334FB
/* 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 */
;
};
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
,
);
};
};
9003969C1B601DF400226B73
/* BUYCartLineItem.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9003969A1B601DF400226B73
/* BUYCartLineItem.m */
;
};
900396AC1B627CB900226B73
/* BUYProductView.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
900396AA1B627CB900226B73
/* BUYProductView.h */
;
};
...
...
@@ -134,7 +146,7 @@
901930E41BC5B9BC00D1134E
/* BUYOptionSelectionViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE9496AF1B4D96D800B38949
/* BUYOptionSelectionViewController.m */
;
};
901930E51BC5B9BC00D1134E
/* BUYVariantOptionView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90516CA21B4D771400E35E45
/* BUYVariantOptionView.m */
;
};
901930E61BC5B9BC00D1134E
/* BUYPresentationControllerForVariantSelection.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BEB74A201B554BF20005A300
/* BUYPresentationControllerForVariantSelection.m */
;
};
901930E81BC5B9BC00D1134E
/* BUYImage
.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A7A1A700B0A0087DB2C
/* BUYImage
.m */
;
};
901930E81BC5B9BC00D1134E
/* BUYImage
Link.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A7A1A700B0A0087DB2C
/* BUYImageLink
.m */
;
};
901930E91BC5B9BC00D1134E
/* BUYProductVariant.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A821A700B0A0087DB2C
/* BUYProductVariant.m */
;
};
901930EA1BC5B9BC00D1134E
/* BUYProductViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
905ECCC11B4C39710094F336
/* BUYProductViewController.m */
;
};
901930EC1BC5B9BC00D1134E
/* BUYError.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE47340E1B66C4EF00AA721A
/* BUYError.m */
;
};
...
...
@@ -187,7 +199,7 @@
901931201BC5B9BC00D1134E
/* BUYCreditCard.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F77374AB19C796BD0039681C
/* BUYCreditCard.m */
;
};
901931211BC5B9BC00D1134E
/* BUYProductImageCollectionViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
904606AE1B6BC8D700754173
/* BUYProductImageCollectionViewCell.m */
;
};
901931221BC5B9BC00D1134E
/* BUYShop.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A841A700B0A0087DB2C
/* BUYShop.m */
;
};
901931231BC5B9BC00D1134E
/* BUYObject.m
m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A941A7010B20087DB2C
/* BUYObject.m
m */
;
};
901931231BC5B9BC00D1134E
/* BUYObject.m
in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A941A7010B20087DB2C
/* BUYObject.
m */
;
};
901931241BC5B9BC00D1134E
/* BUYProductDescriptionCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90516C961B4D76D900E35E45
/* BUYProductDescriptionCell.m */
;
};
901931271BC5B9BC00D1134E
/* BUYAddress.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90AFAA601B01390F00F21C23
/* BUYAddress.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
901931281BC5B9BC00D1134E
/* BUYApplePayHelpers.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE33B4ED1B15FF4D0067982B
/* BUYApplePayHelpers.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
...
@@ -206,7 +218,7 @@
901931371BC5B9BC00D1134E
/* BUYTaxLine.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90AFAA5C1B011EA600F21C23
/* BUYTaxLine.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
901931381BC5B9BC00D1134E
/* BUYVariantSelectionViewController.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE9496B01B4D96D800B38949
/* BUYVariantSelectionViewController.h */
;
};
901931391BC5B9BC00D1134E
/* BUYOptionValueCell.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE1007991B6165EC0031CEE7
/* BUYOptionValueCell.h */
;
};
9019313A1BC5B9BC00D1134E
/* BUYImage
.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A791A700B0A0087DB2C
/* BUYImage
.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9019313A1BC5B9BC00D1134E
/* BUYImage
Link.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A791A700B0A0087DB2C
/* BUYImageLink
.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9019313B1BC5B9BC00D1134E
/* BUYOptionValue.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BEEA83E51B0B76C7000C6483
/* BUYOptionValue.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9019313C1BC5B9BC00D1134E
/* BUYShop.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A831A700B0A0087DB2C
/* BUYShop.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
9019313D1BC5B9BC00D1134E
/* BUYShippingRate.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90AFAA641B01398A00F21C23
/* BUYShippingRate.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
...
@@ -333,12 +345,12 @@
BE9A64561B503CC90033E558
/* BUYCreditCard.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F77374AB19C796BD0039681C
/* BUYCreditCard.m */
;
};
BE9A64571B503CCC0033E558
/* BUYGiftCard.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
42488B321AB8761A005F21A9
/* BUYGiftCard.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
BE9A64581B503CD10033E558
/* BUYGiftCard.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
42488B331AB8761A005F21A9
/* BUYGiftCard.m */
;
};
BE9A64591B503CD40033E558
/* BUYImage
.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A791A700B0A0087DB2C
/* BUYImage
.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
BE9A645A1B503CD90033E558
/* BUYImage
.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A7A1A700B0A0087DB2C
/* BUYImage
.m */
;
};
BE9A64591B503CD40033E558
/* BUYImage
Link.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A791A700B0A0087DB2C
/* BUYImageLink
.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
BE9A645A1B503CD90033E558
/* BUYImage
Link.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A7A1A700B0A0087DB2C
/* BUYImageLink
.m */
;
};
BE9A645B1B503CDC0033E558
/* BUYLineItem.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F7FDA16C19C939FF00AF4E93
/* BUYLineItem.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
BE9A645C1B503CE00033E558
/* BUYLineItem.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
F7FDA16D19C939FF00AF4E93
/* BUYLineItem.m */
;
};
BE9A645D1B503CE30033E558
/* BUYObject.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A931A7010B20087DB2C
/* BUYObject.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
BE9A645E1B503CE60033E558
/* BUYObject.m
m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A941A7010B20087DB2C
/* BUYObject.m
m */
;
};
BE9A645E1B503CE60033E558
/* BUYObject.m
in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A941A7010B20087DB2C
/* BUYObject.
m */
;
};
BE9A645F1B503CE90033E558
/* BUYOption.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A7F1A700B0A0087DB2C
/* BUYOption.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
BE9A64601B503CEC0033E558
/* BUYOption.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A801A700B0A0087DB2C
/* BUYOption.m */
;
};
BE9A64611B503CEF0033E558
/* BUYProduct.h in Headers */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2AF52A7C1A700B0A0087DB2C
/* BUYProduct.h */
;
settings
=
{
ATTRIBUTES
=
(
Public
,
);
};
};
...
...
@@ -426,8 +438,8 @@
2A54742D1A0AA61600822409
/* PassKit.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
PassKit.framework
;
path
=
System/Library/Frameworks/PassKit.framework
;
sourceTree
=
SDKROOT
;
};
2AF52A731A700AC80087DB2C
/* BUYRuntime.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
lineEnding
=
0
;
path
=
BUYRuntime.h
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
2AF52A741A700AC80087DB2C
/* BUYRuntime.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
lineEnding
=
0
;
path
=
BUYRuntime.m
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objc
;
};
2AF52A791A700B0A0087DB2C
/* BUYImage
.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
lineEnding
=
0
;
path
=
BUYImage
.h
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
2AF52A7A1A700B0A0087DB2C
/* BUYImage
.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
lineEnding
=
0
;
path
=
BUYImage
.m
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objc
;
};
2AF52A791A700B0A0087DB2C
/* BUYImage
Link.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
lineEnding
=
0
;
path
=
BUYImageLink
.h
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
2AF52A7A1A700B0A0087DB2C
/* BUYImage
Link.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
lineEnding
=
0
;
path
=
BUYImageLink
.m
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objc
;
};
2AF52A7C1A700B0A0087DB2C
/* BUYProduct.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
lineEnding
=
0
;
path
=
BUYProduct.h
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
2AF52A7D1A700B0A0087DB2C
/* BUYProduct.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
lineEnding
=
0
;
path
=
BUYProduct.m
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objc
;
};
2AF52A7F1A700B0A0087DB2C
/* BUYOption.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
lineEnding
=
0
;
path
=
BUYOption.h
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
...
...
@@ -437,7 +449,7 @@
2AF52A831A700B0A0087DB2C
/* BUYShop.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
lineEnding
=
0
;
path
=
BUYShop.h
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
2AF52A841A700B0A0087DB2C
/* BUYShop.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
lineEnding
=
0
;
path
=
BUYShop.m
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objc
;
};
2AF52A931A7010B20087DB2C
/* BUYObject.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
lineEnding
=
0
;
path
=
BUYObject.h
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
2AF52A941A7010B20087DB2C
/* BUYObject.m
m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.cpp.objcpp
;
lineEnding
=
0
;
path
=
BUYObject.m
m
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
2AF52A941A7010B20087DB2C
/* BUYObject.m
*/
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
lineEnding
=
0
;
path
=
BUYObject.
m
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
42488B321AB8761A005F21A9
/* BUYGiftCard.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYGiftCard.h
;
sourceTree
=
"<group>"
;
};
42488B331AB8761A005F21A9
/* BUYGiftCard.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYGiftCard.m
;
sourceTree
=
"<group>"
;
};
841ADDEB1CB6C942000004B0
/* NSArray+BUYAdditions.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"NSArray+BUYAdditions.h"
;
sourceTree
=
"<group>"
;
};
...
...
@@ -469,6 +481,7 @@
8491103D1CCE988600E53B93
/* BUYFontAdditionsTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYFontAdditionsTests.m
;
sourceTree
=
"<group>"
;
};
8491103F1CCE9DFB00E53B93
/* BUYCoreDataModelAdditionsTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYCoreDataModelAdditionsTests.m
;
sourceTree
=
"<group>"
;
};
849110431CCE9F3F00E53B93
/* BUYTransformerTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYTransformerTests.m
;
sourceTree
=
"<group>"
;
};
849110461CCEA85C00E53B93
/* BUYObserverTests.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYObserverTests.m
;
sourceTree
=
"<group>"
;
};
84980F281CB75AC200CFAB58
/* BUYObjectProtocol.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYObjectProtocol.h
;
sourceTree
=
"<group>"
;
};
84980F2B1CB75B5E00CFAB58
/* BUYModelManagerProtocol.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYModelManagerProtocol.h
;
sourceTree
=
"<group>"
;
};
84980F2E1CB75C2900CFAB58
/* NSEntityDescription+BUYAdditions.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"NSEntityDescription+BUYAdditions.h"
;
sourceTree
=
"<group>"
;
};
...
...
@@ -490,6 +503,12 @@
84CA59BB1CD1378100B2A956
/* BUYTestModel.xcdatamodel */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.xcdatamodel
;
path
=
BUYTestModel.xcdatamodel
;
sourceTree
=
"<group>"
;
};
84CA59BE1CD1609400B2A956
/* TestModel.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
TestModel.h
;
sourceTree
=
"<group>"
;
};
84CA59BF1CD1609400B2A956
/* TestModel.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
TestModel.m
;
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>"
;
};
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>"
;
};
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
;
};
...
...
@@ -751,8 +770,8 @@
841ADE2B1CB6F320000004B0
/* Persistent */
=
{
isa
=
PBXGroup
;
children
=
(
2AF52A791A700B0A0087DB2C
/* BUYImage.h */
,
2AF52A7A1A700B0A0087DB2C
/* BUYImage.m */
,
2AF52A791A700B0A0087DB2C
/* BUYImage
Link
.h */
,
2AF52A7A1A700B0A0087DB2C
/* BUYImage
Link
.m */
,
F7FDA16C19C939FF00AF4E93
/* BUYLineItem.h */
,
F7FDA16D19C939FF00AF4E93
/* BUYLineItem.m */
,
2AF52A7F1A700B0A0087DB2C
/* BUYOption.h */
,
...
...
@@ -844,6 +863,7 @@
90F592F81B0D5F4C0026B382
/* BUYIntegrationTest.m */
,
90F592FE1B0D5F4C0026B382
/* BUYLineItemTest.m */
,
90F592FF1B0D5F4C0026B382
/* BUYObjectTests.m */
,
849110461CCEA85C00E53B93
/* BUYObserverTests.m */
,
8491103F1CCE9DFB00E53B93
/* BUYCoreDataModelAdditionsTests.m */
,
8491102F1CCE708900E53B93
/* BUYRegularExpressionAdditionsTests.m */
,
849110301CCE708900E53B93
/* BUYStringAdditionsTests.m */
,
...
...
@@ -1010,8 +1030,14 @@
9A3B2DC81CD27D5B00BFF49C
/* BUYCustomer.m */
,
BE47340D1B66C4EF00AA721A
/* BUYError.h */
,
BE47340E1B66C4EF00AA721A
/* BUYError.m */
,
84D915471CC03F1600D334FB
/* BUYManagedObject.h */
,
84D915481CC03F1600D334FB
/* BUYManagedObject.m */
,
84D915491CC03F1600D334FB
/* BUYModelManager.h */
,
84D9154A1CC03F1600D334FB
/* BUYModelManager.m */
,
2AF52A931A7010B20087DB2C
/* BUYObject.h */
,
2AF52A941A7010B20087DB2C
/* BUYObject.mm */
,
2AF52A941A7010B20087DB2C
/* BUYObject.m */
,
84D915411CC0359700D334FB
/* BUYObserver.h */
,
84D915421CC0359700D334FB
/* BUYObserver.m */
,
F76CFF1E19CB7C500079C703
/* BUYSerializable.h */
,
9A3B2DDC1CD28D6F00BFF49C
/* BUYSerializable.m */
,
);
...
...
@@ -1117,7 +1143,7 @@
901931371BC5B9BC00D1134E
/* BUYTaxLine.h in Headers */
,
901931381BC5B9BC00D1134E
/* BUYVariantSelectionViewController.h in Headers */
,
901931391BC5B9BC00D1134E
/* BUYOptionValueCell.h in Headers */
,
9019313A1BC5B9BC00D1134E
/* BUYImage.h in Headers */
,
9019313A1BC5B9BC00D1134E
/* BUYImage
Link
.h in Headers */
,
9019313B1BC5B9BC00D1134E
/* BUYOptionValue.h in Headers */
,
9A9C03441CD9369600AE79BD
/* BUYCheckout_Private.h in Headers */
,
9019313C1BC5B9BC00D1134E
/* BUYShop.h in Headers */
,
...
...
@@ -1155,14 +1181,17 @@
901931501BC5B9BC00D1134E
/* BUYOrder.h in Headers */
,
901931531BC5B9BC00D1134E
/* BUYOptionSelectionNavigationController.h in Headers */
,
901931541BC5B9BC00D1134E
/* BUYPresentationControllerWithNavigationController.h in Headers */
,
84D9154C1CC03F1600D334FB
/* BUYManagedObject.h in Headers */
,
901931551BC5B9BC00D1134E
/* BUYPresentationControllerForVariantSelection.h in Headers */
,
901931571BC5B9BC00D1134E
/* BUYObject.h in Headers */
,
901931581BC5B9BC00D1134E
/* BUYRuntime.h in Headers */
,
901931591BC5B9BC00D1134E
/* BUYCollection.h in Headers */
,
84D915441CC0359700D334FB
/* BUYObserver.h in Headers */
,
9019315A1BC5B9BC00D1134E
/* BUYProductImageCollectionViewCell.h in Headers */
,
84980F5F1CB7617E00CFAB58
/* BUYDateTransformer.h in Headers */
,
84980F591CB7617500CFAB58
/* BUYURLTransformer.h in Headers */
,
9019315B1BC5B9BC00D1134E
/* BUYImageKit.h in Headers */
,
84D915501CC03F1600D334FB
/* BUYModelManager.h in Headers */
,
9019315C1BC5B9BC00D1134E
/* BUYCollection+Additions.h in Headers */
,
9032F2DB1BE9457A00BB9EEF
/* BUYCheckoutAttribute.h in Headers */
,
9019315E1BC5B9BC00D1134E
/* BUYError.h in Headers */
,
...
...
@@ -1211,7 +1240,7 @@
849810921CB7E07900CFAB58
/* BUYDeliveryRangeTransformer.h in Headers */
,
BEB74A7D1B5564870005A300
/* BUYVariantSelectionViewController.h in Headers */
,
BE10079B1B6165EC0031CEE7
/* BUYOptionValueCell.h in Headers */
,
BE9A64591B503CD40033E558
/* BUYImage.h in Headers */
,
BE9A64591B503CD40033E558
/* BUYImage
Link
.h in Headers */
,
BE9A64681B503D080033E558
/* BUYOptionValue.h in Headers */
,
BE9A64661B503D010033E558
/* BUYShop.h in Headers */
,
BE9A644D1B503CA20033E558
/* BUYShippingRate.h in Headers */
,
...
...
@@ -1250,15 +1279,18 @@
90E83BC41B9F550E00C95A1B
/* BUYOrder.h in Headers */
,
BEB74A281B554BFB0005A300
/* BUYOptionSelectionNavigationController.h in Headers */
,
BEB74A691B5564160005A300
/* BUYPresentationControllerWithNavigationController.h in Headers */
,
84D9154B1CC03F1600D334FB
/* BUYManagedObject.h in Headers */
,
BEB74A221B554BF20005A300
/* BUYPresentationControllerForVariantSelection.h in Headers */
,
BE9A645D1B503CE30033E558
/* BUYObject.h in Headers */
,
BE9A646E1B503D1E0033E558
/* BUYRuntime.h in Headers */
,
9A9C03431CD9369400AE79BD
/* BUYCheckout_Private.h in Headers */
,
BEB74A901B55A3D00005A300
/* BUYCollection.h in Headers */
,
84D915431CC0359700D334FB
/* BUYObserver.h in Headers */
,
904606AF1B6BC8D700754173
/* BUYProductImageCollectionViewCell.h in Headers */
,
84980F5E1CB7617E00CFAB58
/* BUYDateTransformer.h in Headers */
,
84980F581CB7617500CFAB58
/* BUYURLTransformer.h in Headers */
,
900E7C841B5DA553006F3C81
/* BUYImageKit.h in Headers */
,
84D9154F1CC03F1600D334FB
/* BUYModelManager.h in Headers */
,
900396F61B69563400226B73
/* BUYCollection+Additions.h in Headers */
,
9032F2DA1BE9457A00BB9EEF
/* BUYCheckoutAttribute.h in Headers */
,
BE47340F1B66C4EF00AA721A
/* BUYError.h in Headers */
,
...
...
@@ -1451,8 +1483,9 @@
84980F5B1CB7617500CFAB58
/* BUYURLTransformer.m in Sources */
,
901930E61BC5B9BC00D1134E
/* BUYPresentationControllerForVariantSelection.m in Sources */
,
84980F611CB7617E00CFAB58
/* BUYDateTransformer.m in Sources */
,
901930E81BC5B9BC00D1134E
/* BUYImage.m in Sources */
,
901930E81BC5B9BC00D1134E
/* BUYImage
Link
.m in Sources */
,
901930E91BC5B9BC00D1134E
/* BUYProductVariant.m in Sources */
,
84D9154E1CC03F1600D334FB
/* BUYManagedObject.m in Sources */
,
901930EA1BC5B9BC00D1134E
/* BUYProductViewController.m in Sources */
,
841ADE021CB6C942000004B0
/* NSArray+BUYAdditions.m in Sources */
,
901930EC1BC5B9BC00D1134E
/* BUYError.m in Sources */
,
...
...
@@ -1476,6 +1509,7 @@
901930FD1BC5B9BC00D1134E
/* BUYTaxLine.m in Sources */
,
901930FE1BC5B9BC00D1134E
/* BUYCollection+Additions.m in Sources */
,
84980F351CB75C2900CFAB58
/* NSEntityDescription+BUYAdditions.m in Sources */
,
84D915461CC0359700D334FB
/* BUYObserver.m in Sources */
,
901930FF1BC5B9BC00D1134E
/* BUYVariantOptionBreadCrumbsView.m in Sources */
,
9A3B2DCC1CD27D5B00BFF49C
/* BUYCustomer.m in Sources */
,
901931011BC5B9BC00D1134E
/* BUYTheme+Additions.m in Sources */
,
...
...
@@ -1490,6 +1524,7 @@
901931081BC5B9BC00D1134E
/* BUYRuntime.m in Sources */
,
901931091BC5B9BC00D1134E
/* BUYCart.m in Sources */
,
9019310A1BC5B9BC00D1134E
/* BUYPaymentButton.m in Sources */
,
84D915521CC03F1600D334FB
/* BUYModelManager.m in Sources */
,
841ADE121CB6C942000004B0
/* NSDictionary+BUYAdditions.m in Sources */
,
9019310B1BC5B9BC00D1134E
/* BUYProduct+Options.m in Sources */
,
9019310C1BC5B9BC00D1134E
/* BUYGiftCard.m in Sources */
,
...
...
@@ -1524,7 +1559,7 @@
901931211BC5B9BC00D1134E
/* BUYProductImageCollectionViewCell.m in Sources */
,
84980F4F1CB7613700CFAB58
/* BUYIdentityTransformer.m in Sources */
,
901931221BC5B9BC00D1134E
/* BUYShop.m in Sources */
,
901931231BC5B9BC00D1134E
/* BUYObject.m
m
in Sources */
,
901931231BC5B9BC00D1134E
/* BUYObject.m in Sources */
,
901931241BC5B9BC00D1134E
/* BUYProductDescriptionCell.m in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
...
...
@@ -1552,7 +1587,7 @@
906CF1B11B8B66AE001F7D5B
/* BUYCNPostalAddress.m in Sources */
,
84CA59BC1CD1378100B2A956
/* BUYTestModel.xcdatamodeld in Sources */
,
8491103C1CCE731900E53B93
/* BUYURLAdditionsTests.m in Sources */
,
8491104
01CCE9DFB00E53B93
/* BUYCoreDataModelAdditions
Tests.m in Sources */
,
8491104
A1CCEA85C00E53B93
/* BUYObserver
Tests.m in Sources */
,
84CA59C01CD1609400B2A956
/* TestModel.m in Sources */
,
906CF1AD1B8B5F7D001F7D5B
/* BUYNSPersonNameComponents.m in Sources */
,
BE98DB5C1BB1F4D000C29564
/* OHHTTPStubsResponse+Helpers.m in Sources */
,
...
...
@@ -1571,8 +1606,9 @@
84980F5A1CB7617500CFAB58
/* BUYURLTransformer.m in Sources */
,
BEB74A241B554BF20005A300
/* BUYPresentationControllerForVariantSelection.m in Sources */
,
84980F601CB7617E00CFAB58
/* BUYDateTransformer.m in Sources */
,
BE9A645A1B503CD90033E558
/* BUYImage.m in Sources */
,
BE9A645A1B503CD90033E558
/* BUYImage
Link
.m in Sources */
,
BE9A64641B503CFB0033E558
/* BUYProductVariant.m in Sources */
,
84D9154D1CC03F1600D334FB
/* BUYManagedObject.m in Sources */
,
BEB74A2E1B554E8B0005A300
/* BUYProductViewController.m in Sources */
,
841ADE011CB6C942000004B0
/* NSArray+BUYAdditions.m in Sources */
,
BE4734101B66C4EF00AA721A
/* BUYError.m in Sources */
,
...
...
@@ -1596,6 +1632,7 @@
BE9A64521B503CB80033E558
/* BUYTaxLine.m in Sources */
,
900396F71B69563400226B73
/* BUYCollection+Additions.m in Sources */
,
84980F341CB75C2900CFAB58
/* NSEntityDescription+BUYAdditions.m in Sources */
,
84D915451CC0359700D334FB
/* BUYObserver.m in Sources */
,
90DE92711B9897B6002EF4DA
/* BUYVariantOptionBreadCrumbsView.m in Sources */
,
9A3B2DCB1CD27D5B00BFF49C
/* BUYCustomer.m in Sources */
,
906EAE441B836DE000976165
/* BUYTheme+Additions.m in Sources */
,
...
...
@@ -1610,6 +1647,7 @@
BE9A646F1B503D210033E558
/* BUYRuntime.m in Sources */
,
BE9A644A1B503C980033E558
/* BUYCart.m in Sources */
,
BE9A64831B503DB10033E558
/* BUYPaymentButton.m in Sources */
,
84D915511CC03F1600D334FB
/* BUYModelManager.m in Sources */
,
841ADE111CB6C942000004B0
/* NSDictionary+BUYAdditions.m in Sources */
,
BE9A646B1B503D140033E558
/* BUYProduct+Options.m in Sources */
,
BE9A64581B503CD10033E558
/* BUYGiftCard.m in Sources */
,
...
...
@@ -1644,7 +1682,7 @@
904606B01B6BC8D700754173
/* BUYProductImageCollectionViewCell.m in Sources */
,
84980F4E1CB7613700CFAB58
/* BUYIdentityTransformer.m in Sources */
,
BE9A64671B503D060033E558
/* BUYShop.m in Sources */
,
BE9A645E1B503CE60033E558
/* BUYObject.m
m
in Sources */
,
BE9A645E1B503CE60033E558
/* BUYObject.m in Sources */
,
BEB74A6C1B55641D0005A300
/* BUYProductDescriptionCell.m in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
...
...
Mobile Buy SDK/Mobile Buy SDK/Additions/NSDecimalNumber+BUYAdditions.m
View file @
93460a07
...
...
@@ -40,12 +40,7 @@
numberHandler
=
[[
NSDecimalNumberHandler
alloc
]
initWithRoundingMode
:
NSRoundBankers
scale
:
12
raiseOnExactness
:
NO
raiseOnOverflow
:
NO
raiseOnUnderflow
:
NO
raiseOnDivideByZero
:
NO
];
});
NSDecimalNumber
*
decimalNumber
=
[
valueFromJSON
buy_decimalNumber
];
if
(
decimalNumber
==
nil
)
{
NSLog
(
@"Could not create decimal value: %@"
,
valueFromJSON
);
}
return
[
decimalNumber
decimalNumberByRoundingAccordingToBehavior
:
numberHandler
];
return
[[
valueFromJSON
buy_decimalNumber
]
decimalNumberByRoundingAccordingToBehavior
:
numberHandler
];
}
-
(
NSDecimalNumber
*
)
buy_decimalNumberAsNegative
...
...
Mobile Buy SDK/Mobile Buy SDK/Buy.h
View file @
93460a07
...
...
@@ -43,10 +43,8 @@ FOUNDATION_EXPORT const unsigned char BuyVersionString[];
#import <Buy/BUYCustomer.h>
#import <Buy/BUYDiscount.h>
#import <Buy/BUYGiftCard.h>
#import <Buy/BUYImageLink.h>
#import <Buy/BUYLineItem.h>
#import <Buy/BUYClient.h>
#import <Buy/BUYClient+Customers.h>
#import <Buy/BUYImage.h>
#import <Buy/BUYMaskedCreditCard.h>
#import <Buy/BUYOption.h>
#import <Buy/BUYOptionValue.h>
...
...
@@ -59,7 +57,14 @@ FOUNDATION_EXPORT const unsigned char BuyVersionString[];
#import <Buy/BUYApplePayAdditions.h>
#import <Buy/BUYApplePayHelpers.h>
#import <Buy/BUYClient.h>
#import <Buy/BUYClient+Customers.h>
#import <Buy/BUYError.h>
#import <Buy/BUYManagedObject.h>
#import <Buy/BUYModelManager.h>
#import <Buy/BUYModelManagerProtocol.h>
#import <Buy/BUYObjectProtocol.h>
#import <Buy/BUYObserver.h>
#import <Buy/BUYPaymentButton.h>
#import <Buy/BUYProductViewController.h>
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/BUYManagedObject.h
0 → 100644
View file @
93460a07
//
// 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 @
93460a07
//
// 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 @
93460a07
//
// 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
;
/**
*
* @param model The Core Data managed object model for your given model. Should be the Buy model.
*
* @return A new model manager object.
*/
-
(
instancetype
)
initWithManagedObjectModel
:(
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 @
93460a07
//
// 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
)
init
{
return
[
self
initWithManagedObjectModel
:[
NSManagedObjectModel
mergedModelFromBundles
:@[[
NSBundle
bundleForClass
:[
self
class
]]]]];
}
-
(
instancetype
)
initWithManagedObjectModel
:
(
NSManagedObjectModel
*
)
model
{
self
=
[
super
init
];
if
(
self
)
{
self
.
model
=
model
;
}
return
self
;
}
+
(
instancetype
)
modelManager
{
return
[[
self
alloc
]
init
];
}
-
(
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/Models/BUYModelManagerProtocol.h
View file @
93460a07
...
...
@@ -26,6 +26,8 @@
#import <CoreData/CoreData.h>
@protocol
BUYObject
;
/**
* A protocol for defining an object that can store and retrieve model objects from a data store or other cache.
*/
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObject.h
View file @
93460a07
...
...
@@ -26,6 +26,8 @@
#import <Foundation/Foundation.h>
#import <Buy/BUYObjectProtocol.h>
/**
* This is the base class for all Shopify model objects.
* This class takes care of convertion .json responses into
...
...
@@ -33,7 +35,7 @@
*
* You will generally not need to interact with this class directly.
*/
@interface
BUYObject
:
NSObject
@interface
BUYObject
:
NSObject
<
BUYObject
>
/**
* The identifier of any Shopify model object.
...
...
@@ -59,6 +61,5 @@
-
(
NSSet
*
)
dirtyProperties
;
-
(
void
)
markPropertyAsDirty
:(
NSString
*
)
property
;
-
(
void
)
markAsClean
;
+
(
void
)
trackDirtyProperties
;
@end
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObject.m
0 → 100644
View file @
93460a07
//
// BUYObject.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 "BUYObject.h"
#import "BUYModelManagerProtocol.h"
#import "BUYObserver.h"
#import "BUYRuntime.h"
#import "NSDictionary+BUYAdditions.h"
#import "NSException+BUYAdditions.h"
#import "NSEntityDescription+BUYAdditions.h"
@interface
BUYObject
()
@property
(
nonatomic
,
readwrite
,
weak
)
id
<
BUYModelManager
>
modelManager
;
@property
(
nonatomic
)
BUYObserver
*
dirtyObserver
;
@end
@implementation
BUYObject
#pragma mark - Deprecated
-
(
instancetype
)
init
{
return
[
self
initWithDictionary
:
nil
];
}
-
(
instancetype
)
initWithDictionary
:
(
NSDictionary
*
)
dictionary
{
return
[
self
initWithModelManager
:
nil
JSONDictionary
:
dictionary
];
}
+
(
NSArray
*
)
convertJSONArray
:
(
NSArray
*
)
json
block
:
(
void
(
^
)(
id
obj
))
createdBlock
{
NSMutableArray
*
objects
=
[[
NSMutableArray
alloc
]
init
];
for
(
NSDictionary
*
jsonObject
in
json
)
{
BUYObject
*
obj
=
[[
self
alloc
]
initWithDictionary
:
jsonObject
];
[
objects
addObject
:
obj
];
if
(
createdBlock
)
{
createdBlock
(
obj
);
}
}
return
objects
;
}
+
(
NSArray
*
)
convertJSONArray
:
(
NSArray
*
)
json
{
return
[
self
convertJSONArray
:
json
block
:
nil
];
}
+
(
instancetype
)
convertObject
:
(
id
)
object
{
BUYObject
*
convertedObject
=
nil
;
if
(
!
(
object
==
nil
||
[
object
isKindOfClass
:[
NSNull
class
]]))
{
convertedObject
=
[[
self
alloc
]
initWithDictionary
:
object
];
}
return
convertedObject
;
}
#pragma mark - Dirty Property Tracking
-
(
BOOL
)
isDirty
{
return
[
self
.
dirtyObserver
hasChanges
];
}
-
(
NSSet
*
)
dirtyProperties
{
return
self
.
dirtyObserver
.
changedProperties
;
}
-
(
void
)
markPropertyAsDirty
:
(
NSString
*
)
property
{
[
self
.
dirtyObserver
markPropertyChanged
:
property
];
}
-
(
void
)
markAsClean
{
[
self
.
dirtyObserver
reset
];
}
-
(
BOOL
)
isEqual
:
(
id
)
object
{
if
(
self
==
object
)
return
YES
;
if
(
!
[
object
isKindOfClass
:
self
.
class
])
return
NO
;
BOOL
same
=
([
self
.
identifier
isEqual
:((
BUYObject
*
)
object
).
identifier
]);
return
same
;
}
-
(
NSUInteger
)
hash
{
NSUInteger
hash
=
[
self
.
identifier
hash
];
return
hash
;
}
-
(
void
)
trackDirtyProperties
:
(
NSArray
*
)
properties
{
self
.
dirtyObserver
=
[
BUYObserver
observeProperties
:
properties
ofObject
:
self
];
}
#pragma mark - Dynamic JSON Serialization
+
(
NSArray
*
)
propertyNames
{
static
NSMutableDictionary
*
namesCache
;
static
dispatch_once_t
onceToken
;
dispatch_once
(
&
onceToken
,
^
{
namesCache
=
[
NSMutableDictionary
dictionary
];
});
NSString
*
className
=
NSStringFromClass
(
self
);
NSArray
*
names
=
namesCache
[
className
];
if
(
names
==
nil
)
{
NSMutableSet
*
allNames
=
[
class_getBUYProperties
(
self
)
mutableCopy
];
[
allNames
removeObject
:
NSStringFromSelector
(
@selector
(
dirtyObserver
))];
names
=
[
allNames
allObjects
];
namesCache
[
className
]
=
names
;
}
return
names
;
}
+
(
NSEntityDescription
*
)
entity
{
@throw
BUYAbstractMethod
();
}
+
(
NSString
*
)
entityName
{
@throw
BUYAbstractMethod
();
}
-
(
NSDictionary
*
)
JSONEncodedProperties
{
return
self
.
entity
.
JSONEncodedProperties
;
}
-
(
instancetype
)
initWithModelManager
:
(
id
<
BUYModelManager
>
)
modelManager
JSONDictionary
:
(
NSDictionary
*
)
dictionary
{
self
=
[
super
init
];
if
(
self
)
{
self
.
modelManager
=
modelManager
;
[
self
updateWithDictionary
:
dictionary
];
if
([[
self
class
]
tracksDirtyProperties
])
{
[
self
trackDirtyProperties
:[[
self
class
]
propertyNames
]];
}
}
return
self
;
}
-
(
void
)
updateWithDictionary
:
(
NSDictionary
*
)
dictionary
{
_identifier
=
dictionary
[
@"id"
];
[
self
markAsClean
];
}
-
(
NSDictionary
*
)
jsonDictionaryForCheckout
{
return
self
.
JSONDictionary
;
}
+
(
NSPredicate
*
)
fetchPredicateWithJSON
:
(
NSDictionary
*
)
JSONDictionary
{
return
nil
;
}
+
(
BOOL
)
isPersistentClass
{
return
NO
;
}
+
(
BOOL
)
tracksDirtyProperties
{
return
NO
;
}
-
(
NSEntityDescription
*
)
entity
{
return
[
self
.
modelManager
buy_entityWithName
:[[
self
class
]
entityName
]];
}
-
(
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.
if
([
JSONDictionary
count
])
{
[
self
.
entity
buy_updateObject
:
self
withJSON
:
JSONDictionary
];
}
}
@end
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObject.mm
deleted
100644 → 0
View file @
922d7a64
//
// BUYObject.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 "BUYObject.h"
#import "BUYRuntime.h"
#import <objc/runtime.h>
#import <objc/message.h>
namespace
shopify
{
namespace
mobilebuysdk
{
/**
* Creates and returns a block that is used as the setter method for the persisted subclasses
* The method implementation calls through to its superclasses implementation and then marks
* the attribute as dirty.
*/
template
<
typename
T
>
id
attribute_setter
(
NSString
*
propertyName
,
SEL
selector
)
{
id
setterBlock
=
^
void
(
id
_self
,
T
value
)
{
// we need to cast objc_msgSend so that the compiler inserts proper type information for the passed in value
// not doing so results in strange behaviour (for example, floats never get set)
void
(
*
typed_objc_msgSend
)(
id
,
SEL
,
T
)
=
(
void
(
*
)(
id
,
SEL
,
T
))
objc_msgSend
;
typed_objc_msgSend
(
_self
,
selector
,
value
);
[
_self
markPropertyAsDirty
:
propertyName
];
};
return
setterBlock
;
}
}
}
@implementation
BUYObject
{
NSMutableSet
*
_dirtyProperties
;
}
-
(
instancetype
)
init
{
return
[
self
initWithDictionary
:
nil
];
}
-
(
instancetype
)
initWithDictionary
:
(
NSDictionary
*
)
dictionary
{
self
=
[
super
init
];
if
(
self
)
{
_dirtyProperties
=
[[
NSMutableSet
alloc
]
init
];
[
self
updateWithDictionary
:
dictionary
];
[
self
markAsClean
];
}
return
self
;
}
-
(
void
)
updateWithDictionary
:
(
NSDictionary
*
)
dictionary
{
_identifier
=
dictionary
[
@"id"
];
}
+
(
NSArray
*
)
convertJSONArray
:
(
NSArray
*
)
json
block
:
(
void
(
^
)(
id
obj
))
createdBlock
{
NSMutableArray
*
objects
=
[[
NSMutableArray
alloc
]
init
];
for
(
NSDictionary
*
jsonObject
in
json
)
{
BUYObject
*
obj
=
[[
self
alloc
]
initWithDictionary
:
jsonObject
];
[
objects
addObject
:
obj
];
if
(
createdBlock
)
{
createdBlock
(
obj
);
}
}
return
objects
;
}
+
(
NSArray
*
)
convertJSONArray
:
(
NSArray
*
)
json
{
return
[
self
convertJSONArray
:
json
block
:
nil
];
}
+
(
instancetype
)
convertObject
:
(
id
)
object
{
BUYObject
*
convertedObject
=
nil
;
if
(
!
(
object
==
nil
||
[
object
isKindOfClass
:[
NSNull
class
]]))
{
convertedObject
=
[[
self
alloc
]
initWithDictionary
:
object
];
}
return
convertedObject
;
}
#pragma mark - Dirty Property Tracking
-
(
BOOL
)
isDirty
{
return
[
_dirtyProperties
count
]
>
0
;
}
-
(
NSSet
*
)
dirtyProperties
{
return
[
NSSet
setWithSet
:
_dirtyProperties
];
}
-
(
void
)
markPropertyAsDirty
:
(
NSString
*
)
property
{
[
_dirtyProperties
addObject
:
property
];
}
-
(
void
)
markAsClean
{
[
_dirtyProperties
removeAllObjects
];
}
+
(
id
)
setterBlockForSelector
:
(
SEL
)
selector
property
:
(
NSString
*
)
property
typeEncoding
:
(
const
char
*
)
typeEncoding
{
id
setterBlock
;
switch
(
typeEncoding
[
0
])
{
case
'@'
:
// object
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
id
>
(
property
,
selector
);
break
;
}
case
'B'
:
// C++ style bool/_Bool
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
bool
>
(
property
,
selector
);
break
;
}
case
'c'
:
// char
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
char
>
(
property
,
selector
);
break
;
}
case
'C'
:
// unsigned char
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
unsigned
char
>
(
property
,
selector
);
break
;
}
case
'i'
:
// int
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
int
>
(
property
,
selector
);
break
;
}
case
'I'
:
// unsigned int
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
unsigned
int
>
(
property
,
selector
);
break
;
}
case
's'
:
// short
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
short
>
(
property
,
selector
);
break
;
}
case
'S'
:
// unsigned short
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
unsigned
short
>
(
property
,
selector
);
break
;
}
case
'l'
:
// long
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
long
>
(
property
,
selector
);
break
;
}
case
'L'
:
// unsigned long
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
unsigned
long
>
(
property
,
selector
);
break
;
}
case
'q'
:
// long long
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
long
long
>
(
property
,
selector
);
break
;
}
case
'Q'
:
// unsigned long long
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
unsigned
long
long
>
(
property
,
selector
);
break
;
}
case
'f'
:
// float
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
float
>
(
property
,
selector
);
break
;
}
case
'd'
:
// double
{
setterBlock
=
shopify
::
mobilebuysdk
::
attribute_setter
<
double
>
(
property
,
selector
);
break
;
}
}
return
setterBlock
;
}
+
(
void
)
wrapProperty
:
(
NSString
*
)
property
{
SEL
setter
=
NSSelectorFromString
([
NSString
stringWithFormat
:
@"set%@:"
,
[
NSString
stringWithFormat
:
@"%@%@"
,[[
property
substringToIndex
:
1
]
uppercaseString
],
[
property
substringFromIndex
:
1
]]]);
//Get the setter. don't worry about readonly properties as they're irrelevant for dirty tracking
if
(
setter
&&
[
self
instancesRespondToSelector
:
setter
])
{
Method
setterMethod
=
class_getInstanceMethod
(
self
,
setter
);
IMP
setterImpl
=
method_getImplementation
(
setterMethod
);
NSMethodSignature
*
methodSignature
=
[
self
instanceMethodSignatureForSelector
:
setter
];
if
([
methodSignature
numberOfArguments
]
==
3
)
{
const
char
*
typeEncoding
=
[
methodSignature
getArgumentTypeAtIndex
:
2
];
SEL
newSetter
=
NSSelectorFromString
([
NSString
stringWithFormat
:
@"buy_%@"
,
NSStringFromSelector
(
setter
)]);
id
setterBlock
=
[
self
setterBlockForSelector
:
newSetter
property
:
property
typeEncoding
:
typeEncoding
];
if
(
setterBlock
)
{
//Create 'buy_setX:' that uses the existing implementation
class_addMethod
(
self
,
newSetter
,
setterImpl
,
method_getTypeEncoding
(
setterMethod
));
//Create a new impmlementation
IMP
newImpl
=
imp_implementationWithBlock
(
setterBlock
);
//Then attach that implementation to 'setX:'. This way calling 'setX:' calls our implementation, and 'buy_setX:' calls the original implementation.
class_replaceMethod
(
self
,
setter
,
newImpl
,
method_getTypeEncoding
(
setterMethod
));
}
}
}
}
+
(
void
)
trackDirtyProperties
{
NSSet
*
properties
=
class_getBUYProperties
(
self
);
for
(
NSString
*
property
in
properties
)
{
if
([
property
length
]
>
0
)
{
[
self
wrapProperty
:
property
];
}
}
}
-
(
BOOL
)
isEqual
:
(
id
)
object
{
if
(
self
==
object
)
return
YES
;
if
(
!
[
object
isKindOfClass
:
self
.
class
])
return
NO
;
BOOL
same
=
([
self
.
identifier
isEqual
:((
BUYObject
*
)
object
).
identifier
]);
return
same
;
}
-
(
NSUInteger
)
hash
{
NSUInteger
hash
=
[
self
.
identifier
hash
];
return
hash
;
}
@end
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObserver.h
0 → 100644
View file @
93460a07
//
// BUYObserver.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>
@interface
BUYObserver
:
NSObject
@property
(
nonatomic
,
readonly
)
NSObject
*
object
;
@property
(
nonatomic
,
readonly
)
NSArray
*
observedProperties
;
@property
(
nonatomic
,
readonly
)
NSSet
*
changedProperties
;
@property
(
nonatomic
,
readonly
)
BOOL
hasChanges
;
-
(
instancetype
)
init
NS_UNAVAILABLE
;
-
(
void
)
markPropertyChanged
:(
NSString
*
)
property
;
-
(
void
)
reset
;
-
(
void
)
cancel
;
+
(
instancetype
)
observeProperties
:(
NSArray
<
NSString
*>
*
)
properties
ofObject
:(
id
)
object
;
@end
Mobile Buy SDK/Mobile Buy SDK/Models/BUYObserver.m
0 → 100644
View file @
93460a07
//
// BUYObserver.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 "BUYObserver.h"
static
void
*
kBUYObserverContext
=
&
kBUYObserverContext
;
@interface
BUYObserver
()
@property
(
nonatomic
)
NSObject
*
object
;
@property
(
nonatomic
)
NSArray
*
observedProperties
;
@end
@implementation
BUYObserver
{
NSMutableSet
*
_changedProperties
;
}
-
(
instancetype
)
initWithObject
:
(
id
)
object
properties
:
(
NSArray
<
NSString
*>
*
)
properties
{
self
=
[
super
init
];
if
(
self
)
{
self
.
object
=
object
;
self
.
observedProperties
=
properties
;
_changedProperties
=
[
NSMutableSet
set
];
[
self
startObserving
];
}
return
self
;
}
-
(
void
)
dealloc
{
[
self
stopObserving
];
}
#pragma mark - Accessors
-
(
NSSet
*
)
changedProperties
{
return
[
_changedProperties
copy
];
}
-
(
void
)
addChangedPropertiesObject
:
(
NSString
*
)
object
{
[
_changedProperties
addObject
:
object
];
}
-
(
void
)
removeChangedProperties
:
(
NSSet
*
)
objects
{
[
_changedProperties
minusSet
:
objects
];
}
#pragma mark - Key Value Observing
-
(
void
)
observeValueForKeyPath
:
(
NSString
*
)
keyPath
ofObject
:
(
id
)
object
change
:
(
NSDictionary
<
NSString
*
,
id
>
*
)
change
context
:
(
void
*
)
context
{
if
(
context
==
kBUYObserverContext
)
{
[
self
markPropertyChanged
:
keyPath
];
}
else
{
[
super
observeValueForKeyPath
:
keyPath
ofObject
:
object
change
:
change
context
:
context
];
}
}
-
(
void
)
startObserving
{
for
(
NSString
*
property
in
_observedProperties
)
{
[
_object
addObserver
:
self
forKeyPath
:
property
options
:
0
context
:
kBUYObserverContext
];
}
}
-
(
void
)
stopObserving
{
for
(
NSString
*
property
in
_observedProperties
)
{
[
_object
removeObserver
:
self
forKeyPath
:
property
];
}
}
#pragma mark - BUYObserver
-
(
void
)
markPropertyChanged
:
(
NSString
*
)
property
{
[
self
addChangedPropertiesObject
:
property
];
}
-
(
BOOL
)
hasChanges
{
return
_changedProperties
.
count
>
0
;
}
-
(
void
)
reset
{
[
self
removeChangedProperties
:[
_changedProperties
copy
]];
}
-
(
void
)
cancel
{
[
self
reset
];
[
self
stopObserving
];
_changedProperties
=
nil
;
_observedProperties
=
nil
;
_object
=
nil
;
}
+
(
instancetype
)
observeProperties
:
(
NSArray
<
NSString
*>
*
)
properties
ofObject
:
(
id
)
object
{
return
[[
self
alloc
]
initWithObject
:
object
properties
:
properties
];
}
@end
Mobile Buy SDK/Mobile Buy SDK/Models/BUYSerializable.h
View file @
93460a07
...
...
@@ -24,7 +24,7 @@
// THE SOFTWARE.
//
@import
Foundation
;
#import <Foundation/Foundation.h>
@protocol
BUYSerializable
<
NSObject
>
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImage.h
→
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYImage
Link
.h
View file @
93460a07
//
// BUYImage.h
// BUYImage
Link
.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
BUYImage
Link
:
BUYObject
/**
* 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 @
93460a07
//
// BUYImage.m
// BUYImage
Link
.m
// Mobile Buy SDK
//
// Created by Shopify.
...
...
@@ -24,10 +24,10 @@
// THE SOFTWARE.
//
#import "BUYImage.h"
#import "BUYImage
Link
.h"
#import "NSDateFormatter+BUYAdditions.h"
@implementation
BUYImage
@implementation
BUYImage
Link
-
(
void
)
updateWithDictionary
:(
NSDictionary
*
)
dictionary
{
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.h
View file @
93460a07
...
...
@@ -27,7 +27,7 @@
#import "BUYObject.h"
@class
BUYProductVariant
;
@class
BUYImage
;
@class
BUYImage
Link
;
@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 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".
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYProduct.m
View file @
93460a07
...
...
@@ -24,7 +24,7 @@
// THE SOFTWARE.
//
#import "BUYImage.h"
#import "BUYImage
Link
.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
=
[
BUYImage
Link
convertJSONArray
:
dictionary
[
@"images"
]];
_options
=
[
BUYOption
convertJSONArray
:
dictionary
[
@"options"
]];
_htmlDescription
=
[
dictionary
buy_objectForKey
:
@"body_html"
];
_available
=
[
dictionary
[
@"available"
]
boolValue
];
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/BUYShop.m
View file @
93460a07
...
...
@@ -28,13 +28,6 @@
@implementation
BUYShop
+
(
void
)
initialize
{
if
(
self
==
[
BUYShop
class
])
{
[
self
trackDirtyProperties
];
}
}
-
(
void
)
updateWithDictionary
:(
NSDictionary
*
)
dictionary
{
[
super
updateWithDictionary
:
dictionary
];
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Templates/Persistent/human.h.motemplate
0 → 100644
View file @
93460a07
//
// _<$managedObjectClassName$>.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 <Buy/_<$managedObjectClassName$>.h>
@interface
<
$managedObjectClassName$
>
:
_
<
$
managedObjectClassName
$
>
{}
@end
Mobile Buy SDK/Mobile Buy SDK/Models/Templates/Persistent/human.m.motemplate
0 → 100644
View file @
93460a07
//
// _<$managedObjectClassName$>.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 "<$managedObjectClassName$>.h"
@implementation
<
$managedObjectClassName$
>
@end
Mobile Buy SDK/Mobile Buy SDK/Models/Templates/Persistent/machine.h.motemplate
0 → 100644
View file @
93460a07
//
// _<$managedObjectClassName$>.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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to <$managedObjectClassName$>.h instead.
#import <Buy/BUYManagedObject.h>
<
$
if
hasAdditionalHeaderFile
$
>
#import "<$additionalHeaderFileName$>"
<
$
endif
$
>
#import "BUYModelManager.h"
<
$
if
noninheritedAttributes
.
@count
>
0
$
>
extern
const
struct
<
$
managedObjectClassName
$
>
Attributes
{
<
$
foreach
Attribute
noninheritedAttributes
do
$
>
<
$
if
TemplateVar
.
arc
$
>
__unsafe_unretained
<
$
endif
$
>
NSString
*<
$
Attribute
.
name
$
>
;
<
$
endforeach
do
$
>
}
<
$
managedObjectClassName
$
>
Attributes
;
<
$
endif
$
>
<
$
if
noninheritedRelationships
.
@count
>
0
$
>
extern
const
struct
<
$
managedObjectClassName
$
>
Relationships
{
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
TemplateVar
.
arc
$
>
__unsafe_unretained
<
$
endif
$
>
NSString
*<
$
Relationship
.
name
$
>
;
<
$
endforeach
do
$
>
}
<
$
managedObjectClassName
$
>
Relationships
;
<
$
endif
$
>
<
$
if
noninheritedFetchedProperties
.
@count
>
0
$
>
extern
const
struct
<
$
managedObjectClassName
$
>
FetchedProperties
{
<
$
foreach
FetchedProperty
noninheritedFetchedProperties
do
$
>
<
$
if
TemplateVar
.
arc
$
>
__unsafe_unretained
<
$
endif
$
>
NSString
*<
$
FetchedProperty
.
name
$
>
;
<
$
endforeach
do
$
>
}
<
$
managedObjectClassName
$
>
FetchedProperties
;
<
$
endif
$
>
<
$
if
hasUserInfoKeys
$
>
extern
const
struct
<
$
managedObjectClassName
$
>
UserInfo
{
<
$
foreach
UserInfo
userInfoKeyValues
do
$
>
<
$
if
TemplateVar
.
arc
$
>
__unsafe_unretained
<
$
endif
$
>
NSString
*<
$
UserInfo
.
key
$
>
;
<
$
endforeach
do
$
>
}
<
$
managedObjectClassName
$
>
UserInfo
;
<
$
endif
$
>
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
@class
<
$Relationship
.
destinationEntity
.
managedObjectClassName
$
>
;
<
$
endforeach
do
$
><
$
foreach
Attribute
noninheritedAttributes
do
$
>
<
$
if
Attribute
.
hasTransformableAttributeType
$
>
<
$
if
Attribute
.
objectAttributeTransformableProtocols
$
><
$
foreach
Protocol
Attribute
.
objectAttributeTransformableProtocols
do
$
>
@protocol
<
$Protocol$
>
;
<
$
endforeach
do
$
><
$
else
$
>
@class
<
$Attribute
.
objectAttributeClassName
$
>
;
<
$
endif
$
><
$
endif
$
>
<
$
endforeach
do
$
>
@class
<
$managedObjectClassName$
>
;
@interface
BUYModelManager
(
<
$
managedObjectClassName
$
>
Inserting
)
-
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)
all
<
$
name
$
>
Objects
;
-
(
<
$
managedObjectClassName
$
>
*
)
fetch
<
$
name
$
>
WithIdentifierValue
:
(
int64_t
)
identifier
;
-
(
<
$
managedObjectClassName
$
>
*
)
insert
<
$
name
$
>
WithJSONDictionary
:
(
NSDictionary
*
)
dictionary
;
-
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)
insert
<
$
name
$
>
sWithJSONArray
:
(
NSArray
<
NSDictionary
*>
*
)
array
;
@end
<
$
if
userInfo
.
documentation
$
>
/**
* <$userInfo.documentation$><$if userInfo.discussion$>
*
* <$userInfo.discussion$><$endif$>
*/
<
$
endif
$
>
@interface
_
<
$
managedObjectClassName
$
>
:
<
$
customSuperentity
$
>
+
(
NSString
*
)
entityName
;
<
$
foreach
Attribute
noninheritedAttributes
do
$
>
<
$
if
Attribute
.
userInfo
.
documentation
$
>
/**
* <$Attribute.userInfo.documentation$><$if Attribute.userInfo.discussion$>
*
* <$Attribute.userInfo.discussion$><$endif$>
*/
<
$
endif
$
><
$
if
Attribute
.
hasDefinedAttributeType
$
><
$
if
TemplateVar
.
arc
$
><
$
if
Attribute
.
isReadonly
$
>
@property
(
nonatomic
,
strong
,
readonly
)
<
$
Attribute
.
objectAttributeType
$
>
<
$
Attribute
.
name
$
>
;
<
$
else
$
>
@property
(
nonatomic
,
strong
)
<
$
Attribute
.
objectAttributeType
$
>
<
$
Attribute
.
name
$
>
;
<
$
endif
$
>
<
$
else
$
><
$
if
Attribute
.
isReadonly
$
>
@property
(
nonatomic
,
retain
,
readonly
)
<
$
Attribute
.
objectAttributeType
$
>
<
$
Attribute
.
name
$
>
;
<
$
else
$
>
@property
(
nonatomic
,
retain
)
<
$
Attribute
.
objectAttributeType
$
>
<
$
Attribute
.
name
$
>
;
<
$
endif
$
><
$
endif
$
>
<
$
if
Attribute
.
hasScalarAttributeType
$
>
<
$
if
Attribute
.
isReadonly
$
>
@property
(
atomic
,
readonly
)
<
$
Attribute
.
scalarAttributeType
$
>
<
$
Attribute
.
name
$
>
Value
;
-
(
<
$
Attribute
.
scalarAttributeType
$
>
)
<
$
Attribute
.
name
$
>
Value
;
<
$
else
$
>
@property
(
atomic
)
<
$
Attribute
.
scalarAttributeType
$
>
<
$
Attribute
.
name
$
>
Value
;
-
(
<
$
Attribute
.
scalarAttributeType
$
>
)
<
$
Attribute
.
name
$
>
Value
;
-
(
void
)
set
<
$
Attribute
.
name
.
initialCapitalString
$
>
Value
:
(
<
$
Attribute
.
scalarAttributeType
$
>
)
value_
;
<
$
endif
$
><
$
endif
$
><
$
endif
$
>
<
$
endforeach
do
$
>
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
Relationship
.
userInfo
.
documentation
$
>
/**
* <$Relationship.userInfo.documentation$><$if Relationship.userInfo.discussion$>
*
* <$Relationship.userInfo.discussion$><$endif$>
*/
<
$
endif
$
><
$
if
Relationship
.
isToMany
$
><
$
if
TemplateVar
.
arc
$
>
@property
(
nonatomic
,
strong
)
<
$
Relationship
.
immutableCollectionClassName
$
>
*<
$
Relationship
.
name
$
>
;
<
$
else
$
>
@property
(
nonatomic
,
retain
)
<
$
Relationship
.
immutableCollectionClassName
$
>
*<
$
Relationship
.
name
$
>
;
<
$
endif
$
>
-
(
<
$
Relationship
.
mutableCollectionClassName
$
>
*
)
<
$
Relationship
.
name
$
>
Set
;
<
$
else
$
>
<
$
if
TemplateVar
.
arc
$
>
@property
(
nonatomic
,
strong
)
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>
*<
$
Relationship
.
name
$
>
;
<
$
else
$
>
@property
(
nonatomic
,
retain
)
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>
*<
$
Relationship
.
name
$
>
;
<
$
endif
$
><
$
endif
$
>
<
$
endforeach
do
$
>
<
$
foreach
FetchedProperty
noninheritedFetchedProperties
do
$
>
<
$
if
FetchedProperty
.
userInfo
.
documentation
$
>
/**
* <$FetchedProperty.userInfo.documentation$><$if FetchedProperty.userInfo.documentation$>
*
* <$FetchedProperty.userInfo.discussion$><$endif$>
*/
<
$
endif
$
>
@property
(
nonatomic
,
readonly
)
NSArray
*<
$
FetchedProperty
.
name
$
>
;
<
$
endforeach
do
$
>
<
$
if
TemplateVar
.
frc
$
>
#if TARGET_OS_IPHONE
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
Relationship
.
isToMany
$
>
-
(
NSFetchedResultsController
*
)
new
<
$
Relationship
.
name
.
initialCapitalString
$
>
FetchedResultsControllerWithSortDescriptors
:
(
NSArray
*
)
sortDescriptors
;
<
$
endif
$
>
<
$
endforeach
do
$
>
#endif
<
$
endif
$
>
@end
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
Relationship
.
isToMany
$
>
@interface
_
<
$
managedObjectClassName
$
>
(
<
$
Relationship
.
name
.
initialCapitalString
$
>
CoreDataGeneratedAccessors
)
<
$
if
Relationship
.
isOrdered
$
>
-
(
void
)
insertObject
:
(
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>
*
)
value
in
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndex
:
(
NSUInteger
)
idx
;
-
(
void
)
removeObjectFrom
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndex
:
(
NSUInteger
)
idx
;
-
(
void
)
insert
<
$
Relationship
.
name
.
initialCapitalString
$
>:
(
NSArray
*
)
value
atIndexes
:
(
NSIndexSet
*
)
indexes
;
-
(
void
)
remove
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndexes
:
(
NSIndexSet
*
)
indexes
;
-
(
void
)
replaceObjectIn
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndex
:
(
NSUInteger
)
idx
withObject
:
(
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>
*
)
value
;
-
(
void
)
replace
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndexes
:
(
NSIndexSet
*
)
indexes
with
<
$
Relationship
.
name
.
initialCapitalString
$
>:
(
NSArray
*
)
values
;
<
$
endif
$
>
@end
<
$
endif
$
>
<
$
endforeach
do
$
>
@interface
_
<
$
managedObjectClassName
$
>
(
CoreDataGeneratedPrimitiveAccessors
)
<
$
foreach
Attribute
noninheritedAttributesSansType
do
$
>
<
$
if
Attribute
.
hasDefinedAttributeType
$
>
-
(
<
$
Attribute
.
objectAttributeType
$
>
)
primitive
<
$
Attribute
.
name
.
initialCapitalString
$
>
;
-
(
void
)
setPrimitive
<
$
Attribute
.
name
.
initialCapitalString
$
>:
(
<
$
Attribute
.
objectAttributeType
$
>
)
value
;
<
$
endif
$
>
<
$
endforeach
do
$
>
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
Relationship
.
isToMany
$
>
-
(
<
$
Relationship
.
mutableCollectionClassName
$
>
*
)
primitive
<
$
Relationship
.
name
.
initialCapitalString
$
>
;
-
(
void
)
setPrimitive
<
$
Relationship
.
name
.
initialCapitalString
$
>:
(
<
$
Relationship
.
mutableCollectionClassName
$
>
*
)
value
;
<
$
else
$
>
-
(
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>
*
)
primitive
<
$
Relationship
.
name
.
initialCapitalString
$
>
;
-
(
void
)
setPrimitive
<
$
Relationship
.
name
.
initialCapitalString
$
>:
(
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>
*
)
value
;
<
$
endif
$
>
<
$
endforeach
do
$
>
@end
Mobile Buy SDK/Mobile Buy SDK/Models/Templates/Persistent/machine.m.motemplate
0 → 100644
View file @
93460a07
//
// _<$managedObjectClassName$>.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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to <$managedObjectClassName$>.m instead.
#import "_<$managedObjectClassName$>.h"
<
$
if
noninheritedAttributes
.
@count
>
0
$
>
const
struct
<
$
managedObjectClassName
$
>
Attributes
<
$
managedObjectClassName
$
>
Attributes
=
{
<
$
foreach
Attribute
noninheritedAttributes
do
$
>
.
<
$
Attribute
.
name
$
>
=
@"<$Attribute.name$>"
,
<
$
endforeach
do
$
>
};
<
$
endif
$
>
<
$
if
noninheritedRelationships
.
@count
>
0
$
>
const
struct
<
$
managedObjectClassName
$
>
Relationships
<
$
managedObjectClassName
$
>
Relationships
=
{
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
.
<
$
Relationship
.
name
$
>
=
@"<$Relationship.name$>"
,
<
$
endforeach
do
$
>
};
<
$
endif
$
>
<
$
if
noninheritedFetchedProperties
.
@count
>
0
$
>
const
struct
<
$
managedObjectClassName
$
>
FetchedProperties
<
$
managedObjectClassName
$
>
FetchedProperties
=
{
<
$
foreach
FetchedProperty
noninheritedFetchedProperties
do
$
>
.
<
$
FetchedProperty
.
name
$
>
=
@"<$FetchedProperty.name$>"
,
<
$
endforeach
do
$
>
};
<
$
endif
$
>
<
$
if
hasUserInfoKeys
$
>
const
struct
<
$
managedObjectClassName
$
>
UserInfo
<
$
managedObjectClassName
$
>
UserInfo
=
{
<
$
foreach
UserInfo
userInfoKeyValues
do
$
>
.
<
$
UserInfo
.
key
$
>
=
@"<$UserInfo.value$>"
,
<
$
endforeach
do
$
>
};
<
$
endif
$
>
@implementation
_
<
$
managedObjectClassName
$
>
+
(
NSString
*
)
entityName
{
return
@"<$name$>"
;
}
+
(
NSSet
*
)
keyPathsForValuesAffectingValueForKey
:
(
NSString
*
)
key
{
NSSet
*
keyPaths
=
[
super
keyPathsForValuesAffectingValueForKey
:
key
];
<
$
foreach
Attribute
noninheritedAttributes
do
$
><
$
if
Attribute
.
hasDefinedAttributeType
$
><
$
if
Attribute
.
hasScalarAttributeType
$
>
if
([
key
isEqualToString
:
@"<$Attribute.name$>Value"
])
{
NSSet
*
affectingKey
=
[
NSSet
setWithObject
:
@"<$Attribute.name$>"
];
keyPaths
=
[
keyPaths
setByAddingObjectsFromSet
:
affectingKey
];
return
keyPaths
;
}
<
$
endif
$
><
$
endif
$
><
$
endforeach
do
$
>
return
keyPaths
;
}
#if defined CORE_DATA_PERSISTENCE<$foreach Attribute noninheritedAttributes do$><$if Attribute.hasDefinedAttributeType$>
-
(
<
$
Attribute
.
objectAttributeType
$
>
)
<
$
Attribute
.
name
$
>
{
[
self
willAccessValueForKey
:
@"<$Attribute.name$>"
];
id
value
=
[
self
primitiveValueForKey
:
@"<$Attribute.name$>"
];
[
self
didAccessValueForKey
:
@"<$Attribute.name$>"
];
return
value
;
}
<
$
if
!
Attribute
.
isReadonly
$
>
-
(
void
)
set
<
$
Attribute
.
name
.
initialCapitalString
$
>:
(
<
$
Attribute
.
objectAttributeType
$
>
)
value_
{
[
self
willChangeValueForKey
:
@"<$Attribute.name$>"
];
[
self
setPrimitiveValue
:
value_
forKey
:
@"<$Attribute.name$>"
];
[
self
didChangeValueForKey
:
@"<$Attribute.name$>"
];
}
<
$
endif
$
><
$
endif
$
><
$
endforeach
do
$
>
#endif
<
$
foreach
Attribute
noninheritedAttributes
do
$
>
<
$
if
Attribute
.
hasDefinedAttributeType
$
>
<
$
if
Attribute
.
hasScalarAttributeType
$
>
-
(
<
$
Attribute
.
scalarAttributeType
$
>
)
<
$
Attribute
.
name
$
>
Value
{
NSNumber
*
result
=
[
self
<
$
Attribute
.
name
$
>
];
return
[
result
<
$
Attribute
.
scalarAccessorMethodName
$
>
];
}
<
$
if
!
Attribute
.
isReadonly
$
>
-
(
void
)
set
<
$
Attribute
.
name
.
initialCapitalString
$
>
Value
:
(
<
$
Attribute
.
scalarAttributeType
$
>
)
value_
{
[
self
set
<
$
Attribute
.
name
.
initialCapitalString
$
>:<
$
if
TemplateVar
.
literals
$
>
@
(
value_
)
<
$
else
$
>
[
NSNumber
<
$
Attribute
.
scalarFactoryMethodName
$
>
value_
]
<
$
endif
$
>
];
}
<
$
endif
$
>
<
$
endif
$
>
<
$
endif
$
>
<
$
endforeach
do
$
>
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
#if defined CORE_DATA_PERSISTENCE
@dynamic
<
$
Relationship
.
name
$
>
;
#endif
<
$
if
Relationship
.
isToMany
$
>
-
(
<
$
Relationship
.
mutableCollectionClassName
$
>
*
)
<
$
Relationship
.
name
$
>
Set
{
[
self
willAccessValueForKey
:
@"<$Relationship.name$>"
];
<
$
if
Relationship
.
jr_isOrdered
$
>
<
$
Relationship
.
mutableCollectionClassName
$
>
*
result
=
(
<
$
Relationship
.
mutableCollectionClassName
$
>
*
)[
self
mutableOrderedSetValueForKey
:
@"<$Relationship.name$>"
];
<
$
else
$
>
<
$
Relationship
.
mutableCollectionClassName
$
>
*
result
=
(
<
$
Relationship
.
mutableCollectionClassName
$
>
*
)[
self
mutableSetValueForKey
:
@"<$Relationship.name$>"
];
<
$
endif
$
>
[
self
didAccessValueForKey
:
@"<$Relationship.name$>"
];
return
result
;
}
<
$
endif
$
>
<
$
endforeach
do
$
>
<
$
foreach
FetchedProperty
noninheritedFetchedProperties
do
$
>
@dynamic
<
$
FetchedProperty
.
name
$
>
;
<
$
endforeach
do
$
>
<
$
if
TemplateVar
.
frc
$
>
#if TARGET_OS_IPHONE
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
Relationship
.
isToMany
$
>
-
(
NSFetchedResultsController
*
)
new
<
$
Relationship
.
name
.
initialCapitalString
$
>
FetchedResultsControllerWithSortDescriptors
:
(
NSArray
*
)
sortDescriptors
{
NSFetchRequest
*
fetchRequest
=
[
NSFetchRequest
new
];
<
$
if
!
TemplateVar
.
arc
$
>
[
fetchRequest
autorelease
];
<
$
endif
$
>
fetchRequest
.
entity
=
[
NSEntityDescription
entityForName
:
@"<$Relationship.destinationEntity.name$>"
inManagedObjectContext
:
self
.
managedObjectContext
];
fetchRequest
.
predicate
=
[
NSPredicate
predicateWithFormat
:
@"<$Relationship.inverseRelationship.name$> <$if Relationship.inverseRelationship.isToMany$>CONTAINS<$else$>==<$endif$> %@"
,
self
];
fetchRequest
.
sortDescriptors
=
sortDescriptors
;
<
$
if
indexedNoninheritedAttributes
.
@count
>
0
$
>
NSArray
*
indexedIDs
=
[
NSArray
arrayWithObjects
:
<
$
foreach
Attribute
indexedNoninheritedAttributes
do
$
>
self
.
<
$
Attribute
.
name
$
>
,
<
$
endforeach
do
$
>
nil
];
NSString
*
cacheName
=
[
NSString
stringWithFormat
:
@"mogenerator.<$managedObjectClassName$>.%@.<$Relationship.name$>.%@"
,
indexedIDs
,
sortDescriptors
];
<
$
endif
$
>
return
[[
NSFetchedResultsController
alloc
]
initWithFetchRequest
:
fetchRequest
managedObjectContext
:
self
.
managedObjectContext
sectionNameKeyPath
:
nil
cacheName
:<
$
if
indexedNoninheritedAttributes
.
@count
>
0
$
>
cacheName
<
$
else
$
>
nil
<
$
endif
$
>
];
}
<
$
endif
$
>
<
$
endforeach
do
$
>
#endif
<
$
endif
$
>
@end
#pragma mark -
@implementation
BUYModelManager
(
<
$
managedObjectClassName
$
>
Inserting
)
-
(
<
$
managedObjectClassName
$
>
*
)
insert
<
$
name
$
>
WithJSONDictionary
:
(
NSDictionary
*
)
dictionary
{
return
(
<
$
managedObjectClassName
$
>
*
)[
self
buy_objectWithEntityName
:
@"<$name$>"
JSONDictionary
:
dictionary
];
}
-
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)
insert
<
$
name
$
>
sWithJSONArray
:
(
NSArray
<
NSDictionary
*>
*
)
array
{
return
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)[
self
buy_objectsWithEntityName
:
@"<$name$>"
JSONArray
:
array
];
}
-
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)
all
<
$
name
$
>
Objects
{
return
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)[
self
buy_objectsWithEntityName
:
@"<$name$>"
identifiers
:
nil
];
}
-
(
<
$
managedObjectClassName
$
>
*
)
fetch
<
$
name
$
>
WithIdentifierValue
:
(
int64_t
)
identifier
{
return
(
<
$
managedObjectClassName
$
>
*
)[
self
buy_objectWithEntityName
:
@"<$name$>"
identifier
:
@
(
identifier
)];
}
@end
Mobile Buy SDK/Mobile Buy SDK/Models/Templates/Transient/human.h.motemplate
0 → 100644
View file @
93460a07
//
// _<$managedObjectClassName$>.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 <Buy/_<$managedObjectClassName$>.h>
@interface
<
$managedObjectClassName$
>
:
_
<
$
managedObjectClassName
$
>
{}
@end
Mobile Buy SDK/Mobile Buy SDK/Models/Templates/Transient/human.m.motemplate
0 → 100644
View file @
93460a07
//
// _<$managedObjectClassName$>.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 "<$managedObjectClassName$>.h"
@implementation
<
$managedObjectClassName$
>
@end
Mobile Buy SDK/Mobile Buy SDK/Models/Templates/Transient/machine.h.motemplate
0 → 100644
View file @
93460a07
//
// _<$managedObjectClassName$>.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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to <$managedObjectClassName$>.h instead.
<
$
if
hasCustomSuperentity
$
><
$
if
hasSuperentity
$
>
#
import
<
Buy
/<
$
customSuperentity
$
>
.
h
>
<
$
else
$
><
$
if
hasCustomBaseCaseImport
$
>
#
import
<
$
baseClassImport
$
><
$
else
$
>
#
import
"<$customSuperentity$>.h"
<
$
endif
$
><
$
endif
$
><
$
endif
$
>
<
$
if
hasAdditionalHeaderFile
$
>
#import "<$additionalHeaderFileName$>"
<
$
endif
$
>
#import <Buy/BUYModelManager.h>
<
$
if
noninheritedAttributes
.
@count
>
0
$
>
extern
const
struct
<
$
managedObjectClassName
$
>
Attributes
{
<
$
foreach
Attribute
noninheritedAttributes
do
$
>
<
$
if
TemplateVar
.
arc
$
>
__unsafe_unretained
<
$
endif
$
>
NSString
*<
$
Attribute
.
name
$
>
;
<
$
endforeach
do
$
>
}
<
$
managedObjectClassName
$
>
Attributes
;
<
$
endif
$
>
<
$
if
noninheritedRelationships
.
@count
>
0
$
>
extern
const
struct
<
$
managedObjectClassName
$
>
Relationships
{
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
TemplateVar
.
arc
$
>
__unsafe_unretained
<
$
endif
$
>
NSString
*<
$
Relationship
.
name
$
>
;
<
$
endforeach
do
$
>
}
<
$
managedObjectClassName
$
>
Relationships
;
<
$
endif
$
>
<
$
if
noninheritedFetchedProperties
.
@count
>
0
$
>
extern
const
struct
<
$
managedObjectClassName
$
>
FetchedProperties
{
<
$
foreach
FetchedProperty
noninheritedFetchedProperties
do
$
>
<
$
if
TemplateVar
.
arc
$
>
__unsafe_unretained
<
$
endif
$
>
NSString
*<
$
FetchedProperty
.
name
$
>
;
<
$
endforeach
do
$
>
}
<
$
managedObjectClassName
$
>
FetchedProperties
;
<
$
endif
$
>
<
$
if
hasUserInfoKeys
$
>
extern
const
struct
<
$
managedObjectClassName
$
>
UserInfo
{
<
$
foreach
UserInfo
userInfoKeyValues
do
$
>
<
$
if
TemplateVar
.
arc
$
>
__unsafe_unretained
<
$
endif
$
>
NSString
*<
$
UserInfo
.
key
$
>
;
<
$
endforeach
do
$
>
}
<
$
managedObjectClassName
$
>
UserInfo
;
<
$
endif
$
>
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
@class
<
$Relationship
.
destinationEntity
.
managedObjectClassName
$
>
;
<
$
endforeach
do
$
>
<
$
foreach
Attribute
noninheritedAttributes
do
$
><
$
if
Attribute
.
hasTransformableAttributeType
$
><
$
if
Attribute
.
objectAttributeTransformableProtocols
$
>
<
$
foreach
Protocol
Attribute
.
objectAttributeTransformableProtocols
do
$
>
@protocol
<
$Protocol$
>
;
<
$
endforeach
do
$
><
$
else
$
>
@class
<
$Attribute
.
objectAttributeClassName
$
>
;
<
$
endif
$
><
$
endif
$
>
<
$
endforeach
do
$
>
@class
<
$managedObjectClassName$
>
;
@interface
BUYModelManager
(
<
$
managedObjectClassName
$
>
Inserting
)
-
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)
all
<
$
name
$
>
Objects
;
-
(
<
$
managedObjectClassName
$
>
*
)
fetch
<
$
name
$
>
WithIdentifierValue
:
(
int64_t
)
identifier
;
-
(
<
$
managedObjectClassName
$
>
*
)
insert
<
$
name
$
>
WithJSONDictionary
:
(
NSDictionary
*
)
dictionary
;
-
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)
insert
<
$
name
$
>
sWithJSONArray
:
(
NSArray
<
NSDictionary
*>
*
)
array
;
@end
<
$
if
userInfo
.
documentation
$
>
/**
* <$userInfo.documentation$><$if userInfo.discussion$>
*
* <$userInfo.discussion$><$endif$>
*/
<
$
endif
$
>
@interface
_
<
$
managedObjectClassName
$
>
:
<
$
customSuperentity
$
>
+
(
NSString
*
)
entityName
;
<
$
foreach
Attribute
noninheritedAttributes
do
$
>
<
$
if
Attribute
.
userInfo
.
documentation
$
>
/**
* <$Attribute.userInfo.documentation$><$if Attribute.userInfo.discussion$>
*
* <$Attribute.userInfo.discussion$><$endif$>
*/
<
$
endif
$
><
$
if
Attribute
.
hasDefinedAttributeType
$
><
$
if
TemplateVar
.
arc
$
><
$
if
Attribute
.
isReadonly
$
>
@property
(
nonatomic
,
strong
,
readonly
)
<
$
Attribute
.
objectAttributeType
$
>
<
$
Attribute
.
name
$
>
;
<
$
else
$
>
@property
(
nonatomic
,
strong
)
<
$
Attribute
.
objectAttributeType
$
>
<
$
Attribute
.
name
$
>
;
<
$
endif
$
>
<
$
else
$
>
<
$
if
Attribute
.
isReadonly
$
>
@property
(
nonatomic
,
retain
,
readonly
)
<
$
Attribute
.
objectAttributeType
$
>
<
$
Attribute
.
name
$
>
;
<
$
else
$
>
@property
(
nonatomic
,
retain
)
<
$
Attribute
.
objectAttributeType
$
>
<
$
Attribute
.
name
$
>
;
<
$
endif
$
>
<
$
endif
$
>
<
$
if
Attribute
.
hasScalarAttributeType
$
>
<
$
if
Attribute
.
isReadonly
$
>
@property
(
atomic
,
readonly
)
<
$
Attribute
.
scalarAttributeType
$
>
<
$
Attribute
.
name
$
>
Value
;
-
(
<
$
Attribute
.
scalarAttributeType
$
>
)
<
$
Attribute
.
name
$
>
Value
;
<
$
else
$
>
@property
(
atomic
)
<
$
Attribute
.
scalarAttributeType
$
>
<
$
Attribute
.
name
$
>
Value
;
-
(
<
$
Attribute
.
scalarAttributeType
$
>
)
<
$
Attribute
.
name
$
>
Value
;
-
(
void
)
set
<
$
Attribute
.
name
.
initialCapitalString
$
>
Value
:
(
<
$
Attribute
.
scalarAttributeType
$
>
)
value_
;
<
$
endif
$
><
$
endif
$
><
$
endif
$
>
<
$
endforeach
do
$
>
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
Relationship
.
userInfo
.
documentation
$
>
/**
* <$Relationship.userInfo.documentation$><$if Relationship.userInfo.discussion$>
*
* <$Relationship.userInfo.discussion$><$endif$>
*/
<
$
endif
$
><
$
if
Relationship
.
isToMany
$
><
$
if
TemplateVar
.
arc
$
>
@property
(
nonatomic
,
strong
)
<
$
Relationship
.
immutableCollectionClassName
$
>
*<
$
Relationship
.
name
$
>
;
<
$
else
$
>
@property
(
nonatomic
,
retain
)
<
$
Relationship
.
immutableCollectionClassName
$
>
*<
$
Relationship
.
name
$
>
;
<
$
endif
$
>
-
(
<
$
Relationship
.
mutableCollectionClassName
$
>*
)
<
$
Relationship
.
name
$
>
Set
;
<
$
else
$
><
$
if
TemplateVar
.
arc
$
>
@property
(
nonatomic
,
strong
)
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>
*<
$
Relationship
.
name
$
>
;
<
$
else
$
>
@property
(
nonatomic
,
retain
)
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>
*<
$
Relationship
.
name
$
>
;
<
$
endif
$
><
$
endif
$
>
<
$
endforeach
do
$
>
<
$
foreach
FetchedProperty
noninheritedFetchedProperties
do
$
>
<
$
if
FetchedProperty
.
userInfo
.
documentation
$
>
/**
* <$FetchedProperty.userInfo.documentation$><$if FetchedProperty.userInfo.discussion$>
*
* <$FetchedProperty.userInfo.discussion$><$endif$>
*/
<
$
endif
$
>
@property
(
nonatomic
,
readonly
)
NSArray
*<
$
FetchedProperty
.
name
$
>
;
<
$
endforeach
do
$
>
<
$
if
TemplateVar
.
frc
$
>
#if TARGET_OS_IPHONE
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
Relationship
.
isToMany
$
>
-
(
NSFetchedResultsController
*
)
new
<
$
Relationship
.
name
.
initialCapitalString
$
>
FetchedResultsControllerWithSortDescriptors
:
(
NSArray
*
)
sortDescriptors
;
<
$
endif
$
>
<
$
endforeach
do
$
>
#endif
<
$
endif
$
>
@end
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
Relationship
.
isToMany
$
>
@interface
_
<
$
managedObjectClassName
$
>
(
<
$
Relationship
.
name
.
initialCapitalString
$
>
CoreDataGeneratedAccessors
)
<
$
if
Relationship
.
isOrdered
$
>
-
(
void
)
insertObject
:
(
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>*
)
value
in
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndex
:
(
NSUInteger
)
idx
;
-
(
void
)
removeObjectFrom
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndex
:
(
NSUInteger
)
idx
;
-
(
void
)
insert
<
$
Relationship
.
name
.
initialCapitalString
$
>:
(
NSArray
*
)
value
atIndexes
:
(
NSIndexSet
*
)
indexes
;
-
(
void
)
remove
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndexes
:
(
NSIndexSet
*
)
indexes
;
-
(
void
)
replaceObjectIn
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndex
:
(
NSUInteger
)
idx
withObject
:
(
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>*
)
value
;
-
(
void
)
replace
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndexes
:
(
NSIndexSet
*
)
indexes
with
<
$
Relationship
.
name
.
initialCapitalString
$
>:
(
NSArray
*
)
values
;
<
$
endif
$
>
@end
<
$
endif
$
>
<
$
endforeach
do
$
>
Mobile Buy SDK/Mobile Buy SDK/Models/Templates/Transient/machine.m.motemplate
0 → 100644
View file @
93460a07
//
// _<$managedObjectClassName$>.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.
//
// DO NOT EDIT. This file is machine-generated and constantly overwritten.
// Make changes to <$managedObjectClassName$>.m instead.
#import "_<$managedObjectClassName$>.h"
<
$
if
noninheritedAttributes
.
@count
>
0
$
>
const
struct
<
$
managedObjectClassName
$
>
Attributes
<
$
managedObjectClassName
$
>
Attributes
=
{
<
$
foreach
Attribute
noninheritedAttributes
do
$
>
.
<
$
Attribute
.
name
$
>
=
@"<$Attribute.name$>"
,
<
$
endforeach
do
$
>
};
<
$
endif
$
>
<
$
if
noninheritedRelationships
.
@count
>
0
$
>
const
struct
<
$
managedObjectClassName
$
>
Relationships
<
$
managedObjectClassName
$
>
Relationships
=
{
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
.
<
$
Relationship
.
name
$
>
=
@"<$Relationship.name$>"
,
<
$
endforeach
do
$
>
};
<
$
endif
$
>
<
$
if
noninheritedFetchedProperties
.
@count
>
0
$
>
const
struct
<
$
managedObjectClassName
$
>
FetchedProperties
<
$
managedObjectClassName
$
>
FetchedProperties
=
{
<
$
foreach
FetchedProperty
noninheritedFetchedProperties
do
$
>
.
<
$
FetchedProperty
.
name
$
>
=
@"<$FetchedProperty.name$>"
,
<
$
endforeach
do
$
>
};
<
$
endif
$
>
<
$
if
hasUserInfoKeys
$
>
const
struct
<
$
managedObjectClassName
$
>
UserInfo
<
$
managedObjectClassName
$
>
UserInfo
=
{
<
$
foreach
UserInfo
userInfoKeyValues
do
$
>
.
<
$
UserInfo
.
key
$
>
=
@"<$UserInfo.value$>"
,
<
$
endforeach
do
$
>
};
<
$
endif
$
>
@implementation
_
<
$
managedObjectClassName
$
>
+
(
NSString
*
)
entityName
{
return
@"<$name$>"
;
}
+
(
NSSet
*
)
keyPathsForValuesAffectingValueForKey
:
(
NSString
*
)
key
{
NSSet
*
keyPaths
=
[
super
keyPathsForValuesAffectingValueForKey
:
key
];
<
$
foreach
Attribute
noninheritedAttributes
do
$
><
$
if
Attribute
.
hasDefinedAttributeType
$
><
$
if
Attribute
.
hasScalarAttributeType
$
>
if
([
key
isEqualToString
:
@"<$Attribute.name$>Value"
])
{
NSSet
*
affectingKey
=
[
NSSet
setWithObject
:
@"<$Attribute.name$>"
];
keyPaths
=
[
keyPaths
setByAddingObjectsFromSet
:
affectingKey
];
return
keyPaths
;
}
<
$
endif
$
><
$
endif
$
><
$
endforeach
do
$
>
return
keyPaths
;
}
<
$
foreach
Attribute
noninheritedAttributes
do
$
>
<
$
if
Attribute
.
hasDefinedAttributeType
$
>
<
$
if
Attribute
.
hasScalarAttributeType
$
>
-
(
<
$
Attribute
.
scalarAttributeType
$
>
)
<
$
Attribute
.
name
$
>
Value
{
NSNumber
*
result
=
[
self
<
$
Attribute
.
name
$
>
];
return
[
result
<
$
Attribute
.
scalarAccessorMethodName
$
>
];
}
<
$
if
!
Attribute
.
isReadonly
$
>
-
(
void
)
set
<
$
Attribute
.
name
.
initialCapitalString
$
>
Value
:
(
<
$
Attribute
.
scalarAttributeType
$
>
)
value_
{
[
self
set
<
$
Attribute
.
name
.
initialCapitalString
$
>:<
$
if
TemplateVar
.
literals
$
>
@
(
value_
)
<
$
else
$
>
[
NSNumber
<
$
Attribute
.
scalarFactoryMethodName
$
>
value_
]
<
$
endif
$
>
];
}
<
$
endif
$
>
<
$
endif
$
>
<
$
endif
$
>
<
$
endforeach
do
$
>
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
Relationship
.
isToMany
$
>
-
(
<
$
Relationship
.
mutableCollectionClassName
$
>*
)
<
$
Relationship
.
name
$
>
Set
{
<
$
if
Relationship
.
jr_isOrdered
$
>
return
(
<
$
Relationship
.
mutableCollectionClassName
$
>*
)[
self
mutableOrderedSetValueForKey
:
@"<$Relationship.name$>"
];
<
$
else
$
>
return
(
<
$
Relationship
.
mutableCollectionClassName
$
>*
)[
self
mutableSetValueForKey
:
@"<$Relationship.name$>"
];
<
$
endif
$
>
}
<
$
endif
$
>
<
$
endforeach
do
$
>
<
$
foreach
FetchedProperty
noninheritedFetchedProperties
do
$
>
@dynamic
<
$
FetchedProperty
.
name
$
>
;
<
$
endforeach
do
$
>
<
$
if
TemplateVar
.
frc
$
>
#if TARGET_OS_IPHONE
<
$
foreach
Relationship
noninheritedRelationships
do
$
>
<
$
if
Relationship
.
isToMany
$
>
-
(
NSFetchedResultsController
*
)
new
<
$
Relationship
.
name
.
initialCapitalString
$
>
FetchedResultsControllerWithSortDescriptors
:
(
NSArray
*
)
sortDescriptors
{
NSFetchRequest
*
fetchRequest
=
[
NSFetchRequest
new
];
<
$
if
!
TemplateVar
.
arc
$
>
[
fetchRequest
autorelease
];
<
$
endif
$
>
fetchRequest
.
entity
=
[
NSEntityDescription
entityForName
:
@"<$Relationship.destinationEntity.name$>"
inManagedObjectContext
:
self
.
managedObjectContext
];
fetchRequest
.
predicate
=
[
NSPredicate
predicateWithFormat
:
@"<$Relationship.inverseRelationship.name$> <$if Relationship.inverseRelationship.isToMany$>CONTAINS<$else$>==<$endif$> %@"
,
self
];
fetchRequest
.
sortDescriptors
=
sortDescriptors
;
<
$
if
indexedNoninheritedAttributes
.
@count
>
0
$
>
NSArray
*
indexedIDs
=
[
NSArray
arrayWithObjects
:
<
$
foreach
Attribute
indexedNoninheritedAttributes
do
$
>
self
.
<
$
Attribute
.
name
$
>
,
<
$
endforeach
do
$
>
nil
];
NSString
*
cacheName
=
[
NSString
stringWithFormat
:
@"mogenerator.<$managedObjectClassName$>.%@.<$Relationship.name$>.%@"
,
indexedIDs
,
sortDescriptors
];
<
$
endif
$
>
return
[[
NSFetchedResultsController
alloc
]
initWithFetchRequest
:
fetchRequest
managedObjectContext
:
self
.
managedObjectContext
sectionNameKeyPath
:
nil
cacheName
:<
$
if
indexedNoninheritedAttributes
.
@count
>
0
$
>
cacheName
<
$
else
$
>
nil
<
$
endif
$
>
];
}
<
$
endif
$
>
<
$
endforeach
do
$
>
#endif
<
$
endif
$
>
@end
<
$
foreach
Relationship
noninheritedRelationships
do
$
><
$
if
Relationship
.
isToMany
$
><
$
if
Relationship
.
jr_isOrdered
$
>
@implementation
_
<
$
managedObjectClassName
$
>
(
<
$
Relationship
.
name
.
initialCapitalString
$
>
CoreDataGeneratedAccessors
)
-
(
void
)
insertObject
:
(
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>*
)
value
in
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndex
:
(
NSUInteger
)
idx
{
NSIndexSet
*
indexes
=
[
NSIndexSet
indexSetWithIndex
:
idx
];
[
self
willChange
:
NSKeyValueChangeInsertion
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
NSMutableOrderedSet
*
tmpOrderedSet
=
[
NSMutableOrderedSet
orderedSetWithOrderedSet
:[
self
<
$
Relationship
.
name
$
>
]];
[
tmpOrderedSet
insertObject
:
value
atIndex
:
idx
];
[
self
setValue
:
tmpOrderedSet
forKey
:
@"<$Relationship.name$>"
];
[
self
didChange
:
NSKeyValueChangeInsertion
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
}
-
(
void
)
removeObjectFrom
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndex
:
(
NSUInteger
)
idx
{
NSIndexSet
*
indexes
=
[
NSIndexSet
indexSetWithIndex
:
idx
];
[
self
willChange
:
NSKeyValueChangeRemoval
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
NSMutableOrderedSet
*
tmpOrderedSet
=
[
NSMutableOrderedSet
orderedSetWithOrderedSet
:[
self
<
$
Relationship
.
name
$
>
]];
[
tmpOrderedSet
removeObjectAtIndex
:
idx
];
[
self
setValue
:
tmpOrderedSet
forKey
:
@"<$Relationship.name$>"
];
[
self
didChange
:
NSKeyValueChangeRemoval
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
}
-
(
void
)
insert
<
$
Relationship
.
name
.
initialCapitalString
$
>:
(
NSArray
*
)
value
atIndexes
:
(
NSIndexSet
*
)
indexes
{
[
self
willChange
:
NSKeyValueChangeInsertion
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
NSMutableOrderedSet
*
tmpOrderedSet
=
[
NSMutableOrderedSet
orderedSetWithOrderedSet
:[
self
<
$
Relationship
.
name
$
>
]];
[
tmpOrderedSet
insertObjects
:
value
atIndexes
:
indexes
];
[
self
setValue
:
tmpOrderedSet
forKey
:
@"<$Relationship.name$>"
];
[
self
didChange
:
NSKeyValueChangeInsertion
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
}
-
(
void
)
remove
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndexes
:
(
NSIndexSet
*
)
indexes
{
[
self
willChange
:
NSKeyValueChangeRemoval
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
NSMutableOrderedSet
*
tmpOrderedSet
=
[
NSMutableOrderedSet
orderedSetWithOrderedSet
:[
self
<
$
Relationship
.
name
$
>
]];
[
tmpOrderedSet
removeObjectsAtIndexes
:
indexes
];
[
self
setValue
:
tmpOrderedSet
forKey
:
@"<$Relationship.name$>"
];
[
self
didChange
:
NSKeyValueChangeRemoval
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
}
-
(
void
)
replaceObjectIn
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndex
:
(
NSUInteger
)
idx
withObject
:
(
<
$
Relationship
.
destinationEntity
.
managedObjectClassName
$
>*
)
value
{
NSIndexSet
*
indexes
=
[
NSIndexSet
indexSetWithIndex
:
idx
];
[
self
willChange
:
NSKeyValueChangeReplacement
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
NSMutableOrderedSet
*
tmpOrderedSet
=
[
NSMutableOrderedSet
orderedSetWithOrderedSet
:[
self
<
$
Relationship
.
name
$
>
]];
[
tmpOrderedSet
replaceObjectAtIndex
:
idx
withObject
:
value
];
[
self
setValue
:
tmpOrderedSet
forKey
:
@"<$Relationship.name$>"
];
[
self
didChange
:
NSKeyValueChangeReplacement
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
}
-
(
void
)
replace
<
$
Relationship
.
name
.
initialCapitalString
$
>
AtIndexes
:
(
NSIndexSet
*
)
indexes
with
<
$
Relationship
.
name
.
initialCapitalString
$
>:
(
NSArray
*
)
value
{
[
self
willChange
:
NSKeyValueChangeReplacement
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
NSMutableOrderedSet
*
tmpOrderedSet
=
[
NSMutableOrderedSet
orderedSetWithOrderedSet
:[
self
<
$
Relationship
.
name
$
>
]];
[
tmpOrderedSet
replaceObjectsAtIndexes
:
indexes
withObjects
:
value
];
[
self
setValue
:
tmpOrderedSet
forKey
:
@"<$Relationship.name$>"
];
[
self
didChange
:
NSKeyValueChangeReplacement
valuesAtIndexes
:
indexes
forKey
:
@"<$Relationship.name$>"
];
}
@end
<
$
endif
$
><
$
endif
$
><
$
endforeach
do
$
>
#pragma mark -
@implementation
BUYModelManager
(
<
$
managedObjectClassName
$
>
Inserting
)
-
(
<
$
managedObjectClassName
$
>
*
)
insert
<
$
name
$
>
WithJSONDictionary
:
(
NSDictionary
*
)
dictionary
{
return
(
<
$
managedObjectClassName
$
>
*
)[
self
buy_objectWithEntityName
:
@"<$name$>"
JSONDictionary
:
dictionary
];
}
-
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)
insert
<
$
name
$
>
sWithJSONArray
:
(
NSArray
<
NSDictionary
*>
*
)
array
{
return
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)[
self
buy_objectsWithEntityName
:
@"<$name$>"
JSONArray
:
array
];
}
-
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)
all
<
$
name
$
>
Objects
{
return
(
NSArray
<<
$
managedObjectClassName
$
>
*>
*
)[
self
buy_objectsWithEntityName
:
@"<$name$>"
identifiers
:
nil
];
}
-
(
<
$
managedObjectClassName
$
>
*
)
fetch
<
$
name
$
>
WithIdentifierValue
:
(
int64_t
)
identifier
{
return
(
<
$
managedObjectClassName
$
>
*
)[
self
buy_objectWithEntityName
:
@"<$name$>"
identifier
:
@
(
identifier
)];
}
@end
Mobile Buy SDK/Mobile Buy SDK/Models/Transient/BUYCheckout.m
View file @
93460a07
...
...
@@ -46,11 +46,9 @@
@implementation
BUYCheckout
+
(
void
)
initialize
+
(
BOOL
)
tracksDirtyProperties
{
if
(
self
==
[
BUYCheckout
class
])
{
[
self
trackDirtyProperties
];
}
return
YES
;
}
-
(
instancetype
)
initWithCart
:
(
BUYCart
*
)
cart
...
...
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductView.h
View file @
93460a07
...
...
@@ -30,7 +30,7 @@
@class
BUYProductViewFooter
;
@class
BUYGradientView
;
@class
BUYTheme
;
@class
BUYImage
;
@class
BUYImage
Link
;
@class
BUYProduct
;
/**
...
...
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductView.m
View file @
93460a07
...
...
@@ -32,7 +32,7 @@
#import "BUYProductVariantCell.h"
#import "BUYProductDescriptionCell.h"
#import "BUYProductHeaderCell.h"
#import "BUYImage.h"
#import "BUYImage
Link
.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
];
BUYImage
Link
*
image
=
images
[
page
];
[
self
.
backgroundImageView
setBackgroundProductImage
:
image
];
}
}
...
...
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductViewController.m
View file @
93460a07
...
...
@@ -31,6 +31,7 @@
#import "BUYProduct+Options.h"
#import "BUYProductViewController.h"
#import "BUYImageKit.h"
#import "BUYImageLink.h"
#import "BUYProductView.h"
#import "BUYProductViewFooter.h"
#import "BUYProductHeaderCell.h"
...
...
@@ -45,7 +46,6 @@
#import "BUYError.h"
#import "BUYShop.h"
#import "BUYShopifyErrorCodes.h"
#import "BUYImage.h"
CGFloat
const
BUYMaxProductViewWidth
=
414
.
0
;
// We max out to the width of the iPhone 6+
CGFloat
const
BUYMaxProductViewHeight
=
640
.
0
;
...
...
@@ -566,7 +566,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
];
BUYImage
Link
*
image
=
self
.
product
.
images
[
indexPath
.
row
];
NSURL
*
url
=
[
NSURL
URLWithString
:
image
.
src
];
[
cell
.
productImageView
loadImageWithURL
:
url
completion
:
NULL
];
[
cell
setContentOffset
:
self
.
productView
.
tableView
.
contentOffset
];
...
...
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductViewHeader.m
View file @
93460a07
...
...
@@ -28,7 +28,7 @@
#import "BUYImageView.h"
#import "BUYGradientView.h"
#import "BUYProductImageCollectionViewCell.h"
#import "BUYImage.h"
#import "BUYImage
Link
.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
:
^
(
BUYImage
Link
*
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
];
...
...
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductViewHeaderBackgroundImageView.h
View file @
93460a07
...
...
@@ -27,7 +27,7 @@
@import
UIKit
;
@class
BUYImageView
;
@class
BUYTheme
;
@class
BUYImage
;
@class
BUYImage
Link
;
/**
* 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
:(
BUYImage
Link
*
)
image
;
@end
Mobile Buy SDK/Mobile Buy SDK/Product View/BUYProductViewHeaderBackgroundImageView.m
View file @
93460a07
...
...
@@ -27,7 +27,7 @@
#import "BUYProductViewHeaderBackgroundImageView.h"
#import "BUYTheme.h"
#import "BUYImageView.h"
#import "BUYImage.h"
#import "BUYImage
Link
.h"
#import "BUYTheme+Additions.h"
@interface
BUYProductViewHeaderBackgroundImageView
()
...
...
@@ -86,7 +86,7 @@
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
]]];
NSURL
*
url
=
[
NSURL
URLWithString
:[
NSString
stringWithFormat
:
@"%@"
,
string
]];
...
...
Mobile Buy SDK/Mobile Buy SDK/Static Framework/Buy.h
View file @
93460a07
...
...
@@ -44,7 +44,7 @@
#import "BUYCustomer.h"
#import "BUYDiscount.h"
#import "BUYGiftCard.h"
#import "BUYImage.h"
#import "BUYImage
Link
.h"
#import "BUYLineItem.h"
#import "BUYMaskedCreditCard.h"
#import "BUYOption.h"
...
...
@@ -57,6 +57,11 @@
#import "BUYTaxLine.h"
#import "BUYError.h"
#import "BUYManagedObject.h"
#import "BUYModelManager.h"
#import "BUYModelManagerProtocol.h"
#import "BUYObjectProtocol.h"
#import "BUYObserver.h"
#import "BUYPaymentButton.h"
#import "BUYProductViewController.h"
...
...
Scripts/mogenerator
0 → 100755
View file @
93460a07
File added
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