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
002a528c
Commit
002a528c
authored
Jul 26, 2016
by
Brent Gulanowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "Address.isDefault" boolean <-> "default".
parent
a353280d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
1 deletions
+42
-1
BUYClient+CustomerTests.m
...le Buy SDK/Mobile Buy SDK Tests/BUYClient+CustomerTests.m
+3
-0
contents
... Buy SDK.xcdatamodeld/Mobile Buy SDK.xcdatamodel/contents
+8
-1
_BUYAddress.h
...le Buy SDK/Mobile Buy SDK/Models/Persistent/_BUYAddress.h
+15
-0
_BUYAddress.m
...le Buy SDK/Mobile Buy SDK/Models/Persistent/_BUYAddress.m
+16
-0
No files found.
Mobile Buy SDK/Mobile Buy SDK Tests/BUYClient+CustomerTests.m
View file @
002a528c
...
...
@@ -232,6 +232,9 @@
XCTAssertTrue
([
addresses
.
firstObject
isKindOfClass
:[
BUYAddress
class
]]);
XCTAssertNil
(
error
);
NSArray
*
defaultAddresses
=
[
addresses
filteredArrayUsingPredicate
:[
NSPredicate
predicateWithFormat
:
@"isDefault == 1"
]];
XCTAssertEqual
(
1
,
defaultAddresses
.
count
);
[
expectation
fulfill
];
}];
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Mobile Buy SDK.xcdatamodeld/Mobile Buy SDK.xcdatamodel/contents
View file @
002a528c
...
...
@@ -41,6 +41,13 @@
<entry
key=
"documentation"
value=
"Unique identifier for the address"
/>
</userInfo>
</attribute>
<attribute
name=
"isDefault"
optional=
"YES"
attributeType=
"Boolean"
syncable=
"YES"
>
<userInfo>
<entry
key=
"discussion"
value=
"Maps to "default" key in JSON."
/>
<entry
key=
"documentation"
value=
"Whether the address is the owning customer's default address."
/>
<entry
key=
"JSONPropertyKey"
value=
"default"
/>
</userInfo>
</attribute>
<attribute
name=
"lastName"
optional=
"YES"
attributeType=
"String"
syncable=
"YES"
>
<userInfo>
<entry
key=
"documentation"
value=
"The last name of the person associated with the payment method."
/>
...
...
@@ -983,7 +990,7 @@
<memberEntity
name=
"CheckoutAttribute"
/>
</configuration>
<elements>
<element
name=
"Address"
positionX=
"-990"
positionY=
"1444"
width=
"128"
height=
"2
55
"
/>
<element
name=
"Address"
positionX=
"-990"
positionY=
"1444"
width=
"128"
height=
"2
70
"
/>
<element
name=
"Cart"
positionX=
"-1192"
positionY=
"978"
width=
"128"
height=
"60"
/>
<element
name=
"CartLineItem"
positionX=
"-987"
positionY=
"1183"
width=
"128"
height=
"90"
/>
<element
name=
"Checkout"
positionX=
"-765"
positionY=
"1072"
width=
"128"
height=
"630"
/>
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/_BUYAddress.h
View file @
002a528c
...
...
@@ -39,6 +39,7 @@ extern const struct BUYAddressAttributes {
__unsafe_unretained
NSString
*
countryCode
;
__unsafe_unretained
NSString
*
firstName
;
__unsafe_unretained
NSString
*
identifier
;
__unsafe_unretained
NSString
*
isDefault
;
__unsafe_unretained
NSString
*
lastName
;
__unsafe_unretained
NSString
*
phone
;
__unsafe_unretained
NSString
*
province
;
...
...
@@ -115,6 +116,17 @@ extern const struct BUYAddressUserInfo {
-
(
void
)
setIdentifierValue
:(
int64_t
)
value_
;
/**
* Whether the address is the owning customer's default address.
*
* Maps to "default" key in JSON.
*/
@property
(
nonatomic
,
strong
)
NSNumber
*
isDefault
;
@property
(
atomic
)
BOOL
isDefaultValue
;
-
(
BOOL
)
isDefaultValue
;
-
(
void
)
setIsDefaultValue
:(
BOOL
)
value_
;
/**
* The last name of the person associated with the payment method.
*/
@property
(
nonatomic
,
strong
)
NSString
*
lastName
;
...
...
@@ -169,6 +181,9 @@ extern const struct BUYAddressUserInfo {
-
(
NSNumber
*
)
primitiveIdentifier
;
-
(
void
)
setPrimitiveIdentifier
:(
NSNumber
*
)
value
;
-
(
NSNumber
*
)
primitiveIsDefault
;
-
(
void
)
setPrimitiveIsDefault
:(
NSNumber
*
)
value
;
-
(
NSString
*
)
primitiveLastName
;
-
(
void
)
setPrimitiveLastName
:(
NSString
*
)
value
;
...
...
Mobile Buy SDK/Mobile Buy SDK/Models/Persistent/_BUYAddress.m
View file @
002a528c
...
...
@@ -37,6 +37,7 @@ const struct BUYAddressAttributes BUYAddressAttributes = {
.
countryCode
=
@"countryCode"
,
.
firstName
=
@"firstName"
,
.
identifier
=
@"identifier"
,
.
isDefault
=
@"isDefault"
,
.
lastName
=
@"lastName"
,
.
phone
=
@"phone"
,
.
province
=
@"province"
,
...
...
@@ -66,6 +67,11 @@ const struct BUYAddressUserInfo BUYAddressUserInfo = {
keyPaths
=
[
keyPaths
setByAddingObjectsFromSet
:
affectingKey
];
return
keyPaths
;
}
if
([
key
isEqualToString
:
@"isDefaultValue"
])
{
NSSet
*
affectingKey
=
[
NSSet
setWithObject
:
@"isDefault"
];
keyPaths
=
[
keyPaths
setByAddingObjectsFromSet
:
affectingKey
];
return
keyPaths
;
}
return
keyPaths
;
}
...
...
@@ -79,6 +85,7 @@ const struct BUYAddressUserInfo BUYAddressUserInfo = {
@dynamic
countryCode
;
@dynamic
firstName
;
@dynamic
identifier
;
@dynamic
isDefault
;
@dynamic
lastName
;
@dynamic
phone
;
@dynamic
province
;
...
...
@@ -95,6 +102,15 @@ const struct BUYAddressUserInfo BUYAddressUserInfo = {
[
self
setIdentifier
:
@
(
value_
)];
}
-
(
BOOL
)
isDefaultValue
{
NSNumber
*
result
=
[
self
isDefault
];
return
[
result
boolValue
];
}
-
(
void
)
setIsDefaultValue
:
(
BOOL
)
value_
{
[
self
setIsDefault
:
@
(
value_
)];
}
#if defined CORE_DATA_PERSISTENCE
@dynamic
customer
;
#endif
...
...
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