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
5c64de6e
Commit
5c64de6e
authored
May 18, 2016
by
Dima Bart
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move BUYImageKit and UIFont extensions into sample app.
parent
a8a9b788
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
149 additions
and
18 deletions
+149
-18
BUYImageKit.h
...mple Apps/Sample App Advanced/Library/Utils/BUYImageKit.h
+0
-0
BUYImageKit.m
...mple Apps/Sample App Advanced/Library/Utils/BUYImageKit.m
+0
-0
UIFont+BUYAdditions.h
...s/Sample App Advanced/Library/Utils/UIFont+BUYAdditions.h
+0
-0
UIFont+BUYAdditions.m
...s/Sample App Advanced/Library/Utils/UIFont+BUYAdditions.m
+0
-0
project.pbxproj
.../Mobile Buy SDK Advanced Sample.xcodeproj/project.pbxproj
+20
-0
BUYImageKit.h
...vanced/Mobile Buy SDK Advanced Sample/Utils/BUYImageKit.h
+83
-0
BUYImageKit.m
...vanced/Mobile Buy SDK Advanced Sample/Utils/BUYImageKit.m
+0
-0
UIFont+BUYAdditions.h
...obile Buy SDK Advanced Sample/Utils/UIFont+BUYAdditions.h
+41
-0
UIFont+BUYAdditions.m
...obile Buy SDK Advanced Sample/Utils/UIFont+BUYAdditions.m
+5
-18
project.pbxproj
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
+0
-0
No files found.
Mobile Buy SDK
/Mobile Buy SDK
/Utils/BUYImageKit.h
→
Mobile Buy SDK
Sample Apps/Sample App Advanced/Library
/Utils/BUYImageKit.h
View file @
5c64de6e
File moved
Mobile Buy SDK
/Mobile Buy SDK
/Utils/BUYImageKit.m
→
Mobile Buy SDK
Sample Apps/Sample App Advanced/Library
/Utils/BUYImageKit.m
View file @
5c64de6e
File moved
Mobile Buy SDK
/Mobile Buy SDK
/Utils/UIFont+BUYAdditions.h
→
Mobile Buy SDK
Sample Apps/Sample App Advanced/Library
/Utils/UIFont+BUYAdditions.h
View file @
5c64de6e
File moved
Mobile Buy SDK
/Mobile Buy SDK
/Utils/UIFont+BUYAdditions.m
→
Mobile Buy SDK
Sample Apps/Sample App Advanced/Library
/Utils/UIFont+BUYAdditions.m
View file @
5c64de6e
File moved
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample.xcodeproj/project.pbxproj
View file @
5c64de6e
...
...
@@ -52,6 +52,8 @@
90B262411BB0A726006D888F
/* ProductViewControllerToggleTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90B262401BB0A726006D888F
/* ProductViewControllerToggleTableViewCell.m */
;
};
90B262441BB18B10006D888F
/* ProductViewControllerThemeTintColorTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90B262431BB18B10006D888F
/* ProductViewControllerThemeTintColorTableViewCell.m */
;
};
9A0B0C871CEC8F370037D68F
/* BUYPaymentButton.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C861CEC8F370037D68F
/* BUYPaymentButton.m */
;
};
9A0B0C921CEC90D40037D68F
/* BUYImageKit.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C8F1CEC90D40037D68F
/* BUYImageKit.m */
;
};
9A0B0C931CEC90D40037D68F
/* UIFont+BUYAdditions.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9A0B0C911CEC90D40037D68F
/* UIFont+BUYAdditions.m */
;
};
BE3437A21BC5C19D00C71330
/* Buy.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE34379F1BC5C18400C71330
/* Buy.framework */
;
};
BE3437A31BC5C19D00C71330
/* Buy.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE34379F1BC5C18400C71330
/* Buy.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
BE8B82511B8CF49D00E3F871
/* main.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
BE8B82501B8CF49D00E3F871
/* main.m */
;
};
...
...
@@ -208,6 +210,10 @@
90B262431BB18B10006D888F
/* ProductViewControllerThemeTintColorTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ProductViewControllerThemeTintColorTableViewCell.m
;
sourceTree
=
"<group>"
;
};
9A0B0C851CEC8F370037D68F
/* BUYPaymentButton.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYPaymentButton.h
;
sourceTree
=
"<group>"
;
};
9A0B0C861CEC8F370037D68F
/* BUYPaymentButton.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYPaymentButton.m
;
sourceTree
=
"<group>"
;
};
9A0B0C8E1CEC90D40037D68F
/* BUYImageKit.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
BUYImageKit.h
;
sourceTree
=
"<group>"
;
};
9A0B0C8F1CEC90D40037D68F
/* BUYImageKit.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
BUYImageKit.m
;
sourceTree
=
"<group>"
;
};
9A0B0C901CEC90D40037D68F
/* UIFont+BUYAdditions.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
"UIFont+BUYAdditions.h"
;
sourceTree
=
"<group>"
;
};
9A0B0C911CEC90D40037D68F
/* UIFont+BUYAdditions.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
"UIFont+BUYAdditions.m"
;
sourceTree
=
"<group>"
;
};
BE34378F1BC5C18400C71330
/* Mobile Buy SDK.xcodeproj */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
"wrapper.pb-project"
;
name
=
"Mobile Buy SDK.xcodeproj"
;
path
=
"../../Mobile Buy SDK/Mobile Buy SDK.xcodeproj"
;
sourceTree
=
"<group>"
;
};
BE5E28451B94F5C300D2ECB5
/* Mobile Buy SDK Advanced Sample.entitlements */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
text.xml
;
path
=
"Mobile Buy SDK Advanced Sample.entitlements"
;
sourceTree
=
"<group>"
;
};
BE8B824B1B8CF49D00E3F871
/* Mobile Buy SDK Advanced Sample.app */
=
{
isa
=
PBXFileReference
;
explicitFileType
=
wrapper.application
;
includeInIndex
=
0
;
path
=
"Mobile Buy SDK Advanced Sample.app"
;
sourceTree
=
BUILT_PRODUCTS_DIR
;
};
...
...
@@ -379,6 +385,17 @@
name
=
"Table View Cells"
;
sourceTree
=
"<group>"
;
};
9A0B0C8D1CEC90D40037D68F
/* Utils */
=
{
isa
=
PBXGroup
;
children
=
(
9A0B0C8E1CEC90D40037D68F
/* BUYImageKit.h */
,
9A0B0C8F1CEC90D40037D68F
/* BUYImageKit.m */
,
9A0B0C901CEC90D40037D68F
/* UIFont+BUYAdditions.h */
,
9A0B0C911CEC90D40037D68F
/* UIFont+BUYAdditions.m */
,
);
path
=
Utils
;
sourceTree
=
"<group>"
;
};
BE3437901BC5C18400C71330
/* Products */
=
{
isa
=
PBXGroup
;
children
=
(
...
...
@@ -412,6 +429,7 @@
children
=
(
BE8B82521B8CF49D00E3F871
/* AppDelegate.h */
,
BE8B82531B8CF49D00E3F871
/* AppDelegate.m */
,
9A0B0C8D1CEC90D40037D68F
/* Utils */
,
847612231CAB047600AB17AA
/* Appearance */
,
8476128F1CAB059100AB17AA
/* PaymentButton */
,
BE948D4C1B95087A009AB20B
/* Images.xcassets */
,
...
...
@@ -602,11 +620,13 @@
902C9B8F1BB0729F00FC456E
/* ShippingRateTableViewCell.m in Sources */
,
BE8B829A1B8E72CC00E3F871
/* CheckoutViewController.m in Sources */
,
847612681CAB047600AB17AA
/* Theme+Additions.m in Sources */
,
9A0B0C931CEC90D40037D68F
/* UIFont+BUYAdditions.m in Sources */
,
847612831CAB047600AB17AA
/* VariantOptionView.m in Sources */
,
847612981CAB059100AB17AA
/* UIImage+PaymentButton.m in Sources */
,
8476126E1CAB047600AB17AA
/* CheckoutButton.m in Sources */
,
8476127E1CAB047600AB17AA
/* OptionSelectionNavigationController.m in Sources */
,
847612971CAB059100AB17AA
/* UIButton+PaymentButton.m in Sources */
,
9A0B0C921CEC90D40037D68F
/* BUYImageKit.m in Sources */
,
847612761CAB047600AB17AA
/* ProductVariantCell.m in Sources */
,
847612691CAB047600AB17AA
/* Theme.m in Sources */
,
847612701CAB047600AB17AA
/* GradientView.m in Sources */
,
...
...
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Utils/BUYImageKit.h
0 → 100644
View file @
5c64de6e
//
// BUYImageKit.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
;
@import
UIKit
;
/**
* Image generator for a variety of images using the BUYProductViewController.
*/
@interface
BUYImageKit
:
NSObject
/**
* Generates a close button image for the variant selection navigation bar.
*
* @param frame The frame size of the image
*
* @return A close button image
*/
+
(
UIImage
*
)
imageOfVariantCloseImageWithFrame
:
(
CGRect
)
frame
;
/**
* Generates a checkmark image for use of displaying the previously selected variant
*
* @param frame The frame size of the image
*
* @return A checkmark for the previous variant selection
*/
+
(
UIImage
*
)
imageOfPreviousSelectionIndicatorImageWithFrame
:
(
CGRect
)
frame
;
/**
* Generates a custom disclosure indicator image
*
* @param frame The frame size of the image
* @param color The color for the disclosure indicator
*
* @return A disclusore indicator image
*/
+
(
UIImage
*
)
imageOfDisclosureIndicatorImageWithFrame
:
(
CGRect
)
frame
color
:(
UIColor
*
)
color
;
/**
* Generates a close button image for the product view's navigation bar
*
* @param frame The frame size of the image
* @param color The color for the close button image
* @param hasShadow True if the X should have a drop shadow
*
* @return A close button image
*/
+
(
UIImage
*
)
imageOfProductViewCloseImageWithFrame
:
(
CGRect
)
frame
color
:(
UIColor
*
)
color
hasShadow
:(
BOOL
)
hasShadow
;
/**
* Generates a custom back button image for the variant selection navigation bar
*
* @param frame The frame size of the image
*
* @return A custom back button image
*/
+
(
UIImage
*
)
imageOfVariantBackImageWithFrame
:
(
CGRect
)
frame
;
@end
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Utils/BUYImageKit.m
0 → 100644
View file @
5c64de6e
This diff is collapsed.
Click to expand it.
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Utils/UIFont+BUYAdditions.h
0 → 100644
View file @
5c64de6e
//
// BUYFont.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
UIKit
;
@interface
UIFont
(
BUYAdditions
)
/**
* Class method to allow system fonts to have increased point sizes from the OS default.
*
* @param style The text style for the font.
* @param size A positive value to increase the default font's point size by.
*
* @return A system font with an optionally increased point size.
*/
+
(
UIFont
*
)
preferredFontForTextStyle
:(
NSString
*
)
style
increasedPointSize
:(
CGFloat
)
size
;
@end
Mobile Buy SDK
/Mobile Buy SDK Tests/BUYFontAdditionsTest
s.m
→
Mobile Buy SDK
Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Utils/UIFont+BUYAddition
s.m
View file @
5c64de6e
//
// BUYFont
AdditionsTests
.m
// BUYFont.m
// Mobile Buy SDK
//
// Created by Shopify.
...
...
@@ -24,27 +24,14 @@
// THE SOFTWARE.
//
#import <XCTest/XCTest.h>
#import "UIFont+BUYAdditions.h"
@i
nterface
BUYFontAdditionsTests
:
XCTestCase
@i
mplementation
UIFont
(
BUYAdditions
)
@end
@implementation
BUYFontAdditionsTests
-
(
void
)
testIncreasedFontSize
+
(
UIFont
*
)
preferredFontForTextStyle
:(
NSString
*
)
style
increasedPointSize
:(
CGFloat
)
size
{
static
CGFloat
const
increase
=
2
.
0
;
UIFont
*
font
=
[
UIFont
preferredFontForTextStyle
:
UIFontTextStyleBody
];
CGFloat
newSize
=
font
.
pointSize
+
increase
;
NSMutableDictionary
*
attributes
=
[
font
.
fontDescriptor
.
fontAttributes
mutableCopy
];
attributes
[
UIFontDescriptorSizeAttribute
]
=
@
(
newSize
);
UIFont
*
expected
=
[
UIFont
fontWithDescriptor
:[
UIFontDescriptor
fontDescriptorWithFontAttributes
:
attributes
]
size
:
newSize
];
UIFont
*
actual
=
[
UIFont
preferredFontForTextStyle
:
UIFontTextStyleBody
increasedPointSize
:
increase
];
XCTAssertEqualObjects
(
actual
,
expected
);
UIFontDescriptor
*
descriptor
=
[
UIFontDescriptor
preferredFontDescriptorWithTextStyle
:
style
];
return
[
UIFont
fontWithDescriptor
:
descriptor
size
:
descriptor
.
pointSize
+
size
];
}
@end
Mobile Buy SDK/Mobile Buy SDK.xcodeproj/project.pbxproj
View file @
5c64de6e
This diff is collapsed.
Click to expand it.
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