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
9e0b896b
Commit
9e0b896b
authored
May 19, 2016
by
Gabriel O'Flaherty-Chan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Delete duplicate utils classes, move Product View code into proper folder
parent
fae235ec
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
18 additions
and
418 deletions
+18
-418
project.pbxproj
.../Mobile Buy SDK Advanced Sample.xcodeproj/project.pbxproj
+18
-38
ProductViewControllerThemeStyleTableViewCell.h
...oduct View/ProductViewControllerThemeStyleTableViewCell.h
+0
-0
ProductViewControllerThemeStyleTableViewCell.m
...oduct View/ProductViewControllerThemeStyleTableViewCell.m
+0
-0
ProductViewControllerThemeTintColorTableViewCell.h
...t View/ProductViewControllerThemeTintColorTableViewCell.h
+0
-0
ProductViewControllerThemeTintColorTableViewCell.m
...t View/ProductViewControllerThemeTintColorTableViewCell.m
+0
-0
ProductViewControllerToggleTableViewCell.h
...e/Product View/ProductViewControllerToggleTableViewCell.h
+0
-0
ProductViewControllerToggleTableViewCell.m
...e/Product View/ProductViewControllerToggleTableViewCell.m
+0
-0
BUYImageKit.h
...vanced/Mobile Buy SDK Advanced Sample/Utils/BUYImageKit.h
+0
-83
BUYImageKit.m
...vanced/Mobile Buy SDK Advanced Sample/Utils/BUYImageKit.m
+0
-219
UIFont+BUYAdditions.h
...obile Buy SDK Advanced Sample/Utils/UIFont+BUYAdditions.h
+0
-41
UIFont+BUYAdditions.m
...obile Buy SDK Advanced Sample/Utils/UIFont+BUYAdditions.m
+0
-37
No files found.
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample.xcodeproj/project.pbxproj
View file @
9e0b896b
...
...
@@ -48,12 +48,10 @@
902C9B921BB08FF500FC456E
/* SummaryItemsTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
902C9B911BB08FF500FC456E
/* SummaryItemsTableViewCell.m */
;
};
9079F5F41BB1AAA100CB1B35
/* CollectionListViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
9079F5F31BB1AAA100CB1B35
/* CollectionListViewController.m */
;
};
90A6F42D1BA8BCAC003E7C4F
/* PassKit.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90A6F42C1BA8BCAC003E7C4F
/* PassKit.framework */
;
};
90B2623E1BB0A47B006D888F
/* ProductViewControllerThemeStyleTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
90B2623D1BB0A47B006D888F
/* ProductViewControllerThemeStyleTableViewCell.m */
;
};
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 */
;
};
B2C560B91CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2C560B41CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.m */
;
};
B2C560BA1CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2C560B61CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.m */
;
};
B2C560BB1CEE36C00015AA40
/* ProductViewControllerToggleTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
B2C560B81CEE36C00015AA40
/* ProductViewControllerToggleTableViewCell.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 */
;
};
...
...
@@ -202,18 +200,14 @@
9079F5F21BB1AAA100CB1B35
/* CollectionListViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
CollectionListViewController.h
;
sourceTree
=
"<group>"
;
};
9079F5F31BB1AAA100CB1B35
/* CollectionListViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
CollectionListViewController.m
;
sourceTree
=
"<group>"
;
};
90A6F42C1BA8BCAC003E7C4F
/* PassKit.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
PassKit.framework
;
path
=
System/Library/Frameworks/PassKit.framework
;
sourceTree
=
SDKROOT
;
};
90B2623C1BB0A47B006D888F
/* ProductViewControllerThemeStyleTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ProductViewControllerThemeStyleTableViewCell.h
;
sourceTree
=
"<group>"
;
};
90B2623D1BB0A47B006D888F
/* ProductViewControllerThemeStyleTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ProductViewControllerThemeStyleTableViewCell.m
;
sourceTree
=
"<group>"
;
};
90B2623F1BB0A726006D888F
/* ProductViewControllerToggleTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
lineEnding
=
0
;
path
=
ProductViewControllerToggleTableViewCell.h
;
sourceTree
=
"<group>"
;
xcLanguageSpecificationIdentifier
=
xcode.lang.objcpp
;
};
90B262401BB0A726006D888F
/* ProductViewControllerToggleTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ProductViewControllerToggleTableViewCell.m
;
sourceTree
=
"<group>"
;
};
90B262421BB18B10006D888F
/* ProductViewControllerThemeTintColorTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ProductViewControllerThemeTintColorTableViewCell.h
;
sourceTree
=
"<group>"
;
};
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>"
;
};
B2C560B31CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
ProductViewControllerThemeStyleTableViewCell.h
;
path
=
"Product View/ProductViewControllerThemeStyleTableViewCell.h"
;
sourceTree
=
"<group>"
;
};
B2C560B41CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
ProductViewControllerThemeStyleTableViewCell.m
;
path
=
"Product View/ProductViewControllerThemeStyleTableViewCell.m"
;
sourceTree
=
"<group>"
;
};
B2C560B51CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
ProductViewControllerThemeTintColorTableViewCell.h
;
path
=
"Product View/ProductViewControllerThemeTintColorTableViewCell.h"
;
sourceTree
=
"<group>"
;
};
B2C560B61CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
ProductViewControllerThemeTintColorTableViewCell.m
;
path
=
"Product View/ProductViewControllerThemeTintColorTableViewCell.m"
;
sourceTree
=
"<group>"
;
};
B2C560B71CEE36C00015AA40
/* ProductViewControllerToggleTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
name
=
ProductViewControllerToggleTableViewCell.h
;
path
=
"Product View/ProductViewControllerToggleTableViewCell.h"
;
sourceTree
=
"<group>"
;
};
B2C560B81CEE36C00015AA40
/* ProductViewControllerToggleTableViewCell.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
name
=
ProductViewControllerToggleTableViewCell.m
;
path
=
"Product View/ProductViewControllerToggleTableViewCell.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
;
};
...
...
@@ -371,12 +365,12 @@
90B262451BB18BEF006D888F
/* Table View Cells */
=
{
isa
=
PBXGroup
;
children
=
(
90B2623C1BB0A47B006D888F
/* ProductViewControllerThemeStyleTableViewCell.h */
,
90B2623D1BB0A47B006D888F
/* ProductViewControllerThemeStyleTableViewCell.m */
,
90B262421BB18B10006D888F
/* ProductViewControllerThemeTintColorTableViewCell.h */
,
90B262431BB18B10006D888F
/* ProductViewControllerThemeTintColorTableViewCell.m */
,
90B2623F1BB0A726006D888F
/* ProductViewControllerToggleTableViewCell.h */
,
90B262401BB0A726006D888F
/* ProductViewControllerToggleTableViewCell.m */
,
B2C560B31CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.h */
,
B2C560B41CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.m */
,
B2C560B51CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.h */
,
B2C560B61CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.m */
,
B2C560B71CEE36C00015AA40
/* ProductViewControllerToggleTableViewCell.h */
,
B2C560B81CEE36C00015AA40
/* ProductViewControllerToggleTableViewCell.m */
,
902C9B8D1BB0729F00FC456E
/* ShippingRateTableViewCell.h */
,
902C9B8E1BB0729F00FC456E
/* ShippingRateTableViewCell.m */
,
902C9B901BB08FF500FC456E
/* SummaryItemsTableViewCell.h */
,
...
...
@@ -385,17 +379,6 @@
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
=
(
...
...
@@ -429,7 +412,6 @@
children
=
(
BE8B82521B8CF49D00E3F871
/* AppDelegate.h */
,
BE8B82531B8CF49D00E3F871
/* AppDelegate.m */
,
9A0B0C8D1CEC90D40037D68F
/* Utils */
,
847612231CAB047600AB17AA
/* Appearance */
,
8476128F1CAB059100AB17AA
/* PaymentButton */
,
BE948D4C1B95087A009AB20B
/* Images.xcassets */
,
...
...
@@ -602,15 +584,16 @@
8476127F1CAB047600AB17AA
/* OptionSelectionViewController.m in Sources */
,
9A0B0C871CEC8F370037D68F
/* BUYPaymentButton.m in Sources */
,
8476127C1CAB047600AB17AA
/* HeaderOverlayView.m in Sources */
,
B2C560BA1CEE36C00015AA40
/* ProductViewControllerThemeTintColorTableViewCell.m in Sources */
,
8476127A1CAB047600AB17AA
/* ProductViewHeader.m in Sources */
,
847612841CAB047600AB17AA
/* VariantSelectionViewController.m in Sources */
,
90B2623E1BB0A47B006D888F
/* ProductViewControllerThemeStyleTableViewCell.m in Sources */
,
847612801CAB047600AB17AA
/* OptionValueCell.m in Sources */
,
847612821CAB047600AB17AA
/* OptionBreadCrumbsView.m in Sources */
,
902C9B921BB08FF500FC456E
/* SummaryItemsTableViewCell.m in Sources */
,
8476127D1CAB047600AB17AA
/* ProductViewNavigationController.m in Sources */
,
8476126F1CAB047600AB17AA
/* ErrorView.m in Sources */
,
847612811CAB047600AB17AA
/* VariantSelectionPresentationController.m in Sources */
,
B2C560BB1CEE36C00015AA40
/* ProductViewControllerToggleTableViewCell.m in Sources */
,
847612781CAB047600AB17AA
/* ProductViewController.m in Sources */
,
8476126A1CAB047600AB17AA
/* VisualEffectView.m in Sources */
,
847612721CAB047600AB17AA
/* ProductViewPresentationController.m in Sources */
,
...
...
@@ -620,18 +603,14 @@
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 */
,
90B262441BB18B10006D888F
/* ProductViewControllerThemeTintColorTableViewCell.m in Sources */
,
90B262411BB0A726006D888F
/* ProductViewControllerToggleTableViewCell.m in Sources */
,
847612961CAB059100AB17AA
/* ImageKit.m in Sources */
,
847612A21CAB05BE00AB17AA
/* UIImage+BUYAdditions.m in Sources */
,
847612771CAB047600AB17AA
/* ProductView.m in Sources */
,
...
...
@@ -646,6 +625,7 @@
847612711CAB047600AB17AA
/* AsyncImageView.m in Sources */
,
84BA52EE1CB2E83C00AB1560
/* NavigationController.m in Sources */
,
847612751CAB047600AB17AA
/* ProductImageCell.m in Sources */
,
B2C560B91CEE36C00015AA40
/* ProductViewControllerThemeStyleTableViewCell.m in Sources */
,
847612741CAB047600AB17AA
/* ProductHeaderCell.m in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
...
...
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/ProductViewControllerThemeStyleTableViewCell.h
→
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Product
View/Product
ViewControllerThemeStyleTableViewCell.h
View file @
9e0b896b
File moved
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/ProductViewControllerThemeStyleTableViewCell.m
→
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Product
View/Product
ViewControllerThemeStyleTableViewCell.m
View file @
9e0b896b
File moved
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/ProductViewControllerThemeTintColorTableViewCell.h
→
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Product
View/Product
ViewControllerThemeTintColorTableViewCell.h
View file @
9e0b896b
File moved
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/ProductViewControllerThemeTintColorTableViewCell.m
→
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Product
View/Product
ViewControllerThemeTintColorTableViewCell.m
View file @
9e0b896b
File moved
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/ProductViewControllerToggleTableViewCell.h
→
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Product
View/Product
ViewControllerToggleTableViewCell.h
View file @
9e0b896b
File moved
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/ProductViewControllerToggleTableViewCell.m
→
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Product
View/Product
ViewControllerToggleTableViewCell.m
View file @
9e0b896b
File moved
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Utils/BUYImageKit.h
deleted
100644 → 0
View file @
fae235ec
//
// 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
deleted
100644 → 0
View file @
fae235ec
//
// BUYImageKit.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 "BUYImageKit.h"
@implementation
BUYImageKit
#pragma mark Drawing Methods
+
(
void
)
drawVariantCloseImageWithFrame
:
(
CGRect
)
frame
{
//// Color Declarations
UIColor
*
closeColor
=
[
UIColor
colorWithRed
:
0
.
596
f
green
:
0
.
596
f
blue
:
0
.
596
f
alpha
:
1
];
//// Variant Close Icon Drawing
UIBezierPath
*
variantCloseIconPath
=
UIBezierPath
.
bezierPath
;
[
variantCloseIconPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
13971
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
16669
f
*
CGRectGetHeight
(
frame
))];
[
variantCloseIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
93886
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
87988
f
*
CGRectGetHeight
(
frame
))];
[
variantCloseIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
86029
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
95000
f
*
CGRectGetHeight
(
frame
))];
[
variantCloseIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
06114
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
23681
f
*
CGRectGetHeight
(
frame
))];
[
variantCloseIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
13971
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
16669
f
*
CGRectGetHeight
(
frame
))];
[
variantCloseIconPath
closePath
];
[
variantCloseIconPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
86029
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
16669
f
*
CGRectGetHeight
(
frame
))];
[
variantCloseIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
93886
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
23681
f
*
CGRectGetHeight
(
frame
))];
[
variantCloseIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
13971
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
95000
f
*
CGRectGetHeight
(
frame
))];
[
variantCloseIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
06114
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
87988
f
*
CGRectGetHeight
(
frame
))];
[
variantCloseIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
86029
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
16669
f
*
CGRectGetHeight
(
frame
))];
[
variantCloseIconPath
closePath
];
[
closeColor
setFill
];
[
variantCloseIconPath
fill
];
}
+
(
void
)
drawPreviousSelectionIndicatorImageWithFrame
:
(
CGRect
)
frame
{
//// Color Declarations
UIColor
*
indicatorColor
=
[
UIColor
colorWithRed
:
0
green
:
0
blue
:
0
alpha
:
1
];
//// Previous Selection Indicator Drawing
UIBezierPath
*
previousSelectionIndicatorPath
=
UIBezierPath
.
bezierPath
;
[
previousSelectionIndicatorPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
50000
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
1
.
00000
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addCurveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
00000
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
50000
f
*
CGRectGetHeight
(
frame
))
controlPoint1
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
22386
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
1
.
00000
f
*
CGRectGetHeight
(
frame
))
controlPoint2
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
00000
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
77614
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addCurveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
50000
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
00000
f
*
CGRectGetHeight
(
frame
))
controlPoint1
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
00000
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
22386
f
*
CGRectGetHeight
(
frame
))
controlPoint2
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
22386
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
00000
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addCurveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
1
.
00000
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
50000
f
*
CGRectGetHeight
(
frame
))
controlPoint1
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
77614
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
00000
f
*
CGRectGetHeight
(
frame
))
controlPoint2
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
1
.
00000
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
22386
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addCurveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
50000
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
1
.
00000
f
*
CGRectGetHeight
(
frame
))
controlPoint1
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
1
.
00000
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
77614
f
*
CGRectGetHeight
(
frame
))
controlPoint2
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
77614
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
1
.
00000
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
closePath
];
[
previousSelectionIndicatorPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
74926
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
28003
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
40000
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
62929
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
25074
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
48003
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
18002
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
55074
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
39926
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
76997
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
40000
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
76924
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
40073
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
76997
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
81997
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
35074
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
74926
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
28003
f
*
CGRectGetHeight
(
frame
))];
[
previousSelectionIndicatorPath
closePath
];
[
indicatorColor
setFill
];
[
previousSelectionIndicatorPath
fill
];
}
+
(
void
)
drawDisclosureIndicatorImageWithFrame
:
(
CGRect
)
frame
color
:(
UIColor
*
)
arrowColor
{
//// Disclosure Indicator Drawing
UIBezierPath
*
disclosureIndicatorPath
=
UIBezierPath
.
bezierPath
;
[
disclosureIndicatorPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
25149
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
06
878
f
*
CGRectGetHeight
(
frame
))];
[
disclosureIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
93995
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
49908
f
*
CGRectGetHeight
(
frame
))];
[
disclosureIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
79854
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
58746
f
*
CGRectGetHeight
(
frame
))];
[
disclosureIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
11004
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
15717
f
*
CGRectGetHeight
(
frame
))];
[
disclosureIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
25149
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
06
878
f
*
CGRectGetHeight
(
frame
))];
[
disclosureIndicatorPath
closePath
];
[
disclosureIndicatorPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
79854
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
41253
f
*
CGRectGetHeight
(
frame
))];
[
disclosureIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
93995
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
50092
f
*
CGRectGetHeight
(
frame
))];
[
disclosureIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
25149
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
93121
f
*
CGRectGetHeight
(
frame
))];
[
disclosureIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
11004
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
84282
f
*
CGRectGetHeight
(
frame
))];
[
disclosureIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
79854
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
41253
f
*
CGRectGetHeight
(
frame
))];
[
disclosureIndicatorPath
closePath
];
[
arrowColor
setFill
];
[
disclosureIndicatorPath
fill
];
}
+
(
void
)
drawProductViewCloseImageWithFrame
:
(
CGRect
)
frame
color
:(
UIColor
*
)
closeColor2
hasShadow
:(
BOOL
)
hasShadow
{
//// General Declarations
CGContextRef
context
=
UIGraphicsGetCurrentContext
();
//// Color Declarations
UIColor
*
closeShadowColor
=
[
UIColor
colorWithRed
:
0
green
:
0
blue
:
0
alpha
:
1
];
//// Shadow Declarations
NSShadow
*
closeDropShadow
=
[[
NSShadow
alloc
]
init
];
[
closeDropShadow
setShadowColor
:
[
closeShadowColor
colorWithAlphaComponent
:
0
.
15
f
]];
[
closeDropShadow
setShadowOffset
:
CGSizeMake
(
0
.
1
f
,
1
.
1
f
)];
[
closeDropShadow
setShadowBlurRadius
:
2
];
//// Close Icon Drawing
UIBezierPath
*
closeIconPath
=
UIBezierPath
.
bezierPath
;
[
closeIconPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
11431
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
09548
f
*
CGRectGetHeight
(
frame
))];
[
closeIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
85907
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
84024
f
*
CGRectGetHeight
(
frame
))];
[
closeIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
79479
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
90452
f
*
CGRectGetHeight
(
frame
))];
[
closeIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
05002
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
15976
f
*
CGRectGetHeight
(
frame
))];
[
closeIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
11431
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
09548
f
*
CGRectGetHeight
(
frame
))];
[
closeIconPath
closePath
];
[
closeIconPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
79479
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
09548
f
*
CGRectGetHeight
(
frame
))];
[
closeIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
85907
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
15976
f
*
CGRectGetHeight
(
frame
))];
[
closeIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
11431
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
90452
f
*
CGRectGetHeight
(
frame
))];
[
closeIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
05002
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
84024
f
*
CGRectGetHeight
(
frame
))];
[
closeIconPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
79479
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
09548
f
*
CGRectGetHeight
(
frame
))];
[
closeIconPath
closePath
];
CGContextSaveGState
(
context
);
if
(
hasShadow
)
{
CGContextSetShadowWithColor
(
context
,
closeDropShadow
.
shadowOffset
,
closeDropShadow
.
shadowBlurRadius
,
[
closeDropShadow
.
shadowColor
CGColor
]);
}
[
closeColor2
setFill
];
[
closeIconPath
fill
];
CGContextRestoreGState
(
context
);
}
+
(
void
)
drawVariantBackImageWithFrame
:
(
CGRect
)
frame
{
//// Color Declarations
UIColor
*
indicatorColor3
=
[
UIColor
colorWithRed
:
0
.
596
f
green
:
0
.
596
f
blue
:
0
.
596
f
alpha
:
1
];
//// Variant Back Indicator Drawing
UIBezierPath
*
variantBackIndicatorPath
=
UIBezierPath
.
bezierPath
;
[
variantBackIndicatorPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
20956
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
42225
f
*
CGRectGetHeight
(
frame
))];
[
variantBackIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
86663
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
86029
f
*
CGRectGetHeight
(
frame
))];
[
variantBackIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
74878
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
93886
f
*
CGRectGetHeight
(
frame
))];
[
variantBackIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
09171
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
50082
f
*
CGRectGetHeight
(
frame
))];
[
variantBackIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
20956
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
42225
f
*
CGRectGetHeight
(
frame
))];
[
variantBackIndicatorPath
closePath
];
[
variantBackIndicatorPath
moveToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
74878
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
06114
f
*
CGRectGetHeight
(
frame
))];
[
variantBackIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
86663
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
13971
f
*
CGRectGetHeight
(
frame
))];
[
variantBackIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
20956
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
57775
f
*
CGRectGetHeight
(
frame
))];
[
variantBackIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
09171
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
49918
f
*
CGRectGetHeight
(
frame
))];
[
variantBackIndicatorPath
addLineToPoint
:
CGPointMake
(
CGRectGetMinX
(
frame
)
+
0
.
74878
f
*
CGRectGetWidth
(
frame
),
CGRectGetMinY
(
frame
)
+
0
.
06114
f
*
CGRectGetHeight
(
frame
))];
[
variantBackIndicatorPath
closePath
];
[
indicatorColor3
setFill
];
[
variantBackIndicatorPath
fill
];
}
#pragma mark Generated Images
+
(
UIImage
*
)
imageOfVariantCloseImageWithFrame
:
(
CGRect
)
frame
{
UIGraphicsBeginImageContextWithOptions
(
frame
.
size
,
NO
,
0
.
0
f
);
[
BUYImageKit
drawVariantCloseImageWithFrame
:
frame
];
UIImage
*
imageOfVariantCloseImage
=
UIGraphicsGetImageFromCurrentImageContext
();
UIGraphicsEndImageContext
();
return
imageOfVariantCloseImage
;
}
+
(
UIImage
*
)
imageOfPreviousSelectionIndicatorImageWithFrame
:
(
CGRect
)
frame
{
UIGraphicsBeginImageContextWithOptions
(
frame
.
size
,
NO
,
0
.
0
f
);
[
BUYImageKit
drawPreviousSelectionIndicatorImageWithFrame
:
frame
];
UIImage
*
imageOfPreviousSelectionIndicatorImage
=
UIGraphicsGetImageFromCurrentImageContext
();
UIGraphicsEndImageContext
();
return
imageOfPreviousSelectionIndicatorImage
;
}
+
(
UIImage
*
)
imageOfDisclosureIndicatorImageWithFrame
:
(
CGRect
)
frame
color
:(
UIColor
*
)
color
;
{
UIGraphicsBeginImageContextWithOptions
(
frame
.
size
,
NO
,
0
.
0
f
);
[
BUYImageKit
drawDisclosureIndicatorImageWithFrame
:
frame
color
:
color
];
UIImage
*
imageOfDisclosureIndicatorImage
=
UIGraphicsGetImageFromCurrentImageContext
();
UIGraphicsEndImageContext
();
return
imageOfDisclosureIndicatorImage
;
}
+
(
UIImage
*
)
imageOfProductViewCloseImageWithFrame
:
(
CGRect
)
frame
color
:
(
UIColor
*
)
color
hasShadow
:
(
BOOL
)
hasShadow
;
{
UIGraphicsBeginImageContextWithOptions
(
frame
.
size
,
NO
,
0
.
0
f
);
[
BUYImageKit
drawProductViewCloseImageWithFrame
:
frame
color
:
color
hasShadow
:
hasShadow
];
UIImage
*
imageOfProductViewCloseImage
=
UIGraphicsGetImageFromCurrentImageContext
();
UIGraphicsEndImageContext
();
return
imageOfProductViewCloseImage
;
}
+
(
UIImage
*
)
imageOfVariantBackImageWithFrame
:
(
CGRect
)
frame
{
UIGraphicsBeginImageContextWithOptions
(
frame
.
size
,
NO
,
0
.
0
f
);
[
BUYImageKit
drawVariantBackImageWithFrame
:
frame
];
UIImage
*
imageOfVariantBackImage
=
UIGraphicsGetImageFromCurrentImageContext
();
UIGraphicsEndImageContext
();
return
imageOfVariantBackImage
;
}
@end
Mobile Buy SDK Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Utils/UIFont+BUYAdditions.h
deleted
100644 → 0
View file @
fae235ec
//
// 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 Sample Apps/Sample App Advanced/Mobile Buy SDK Advanced Sample/Utils/UIFont+BUYAdditions.m
deleted
100644 → 0
View file @
fae235ec
//
// BUYFont.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 "UIFont+BUYAdditions.h"
@implementation
UIFont
(
BUYAdditions
)
+
(
UIFont
*
)
preferredFontForTextStyle
:(
NSString
*
)
style
increasedPointSize
:(
CGFloat
)
size
{
UIFontDescriptor
*
descriptor
=
[
UIFontDescriptor
preferredFontDescriptorWithTextStyle
:
style
];
return
[
UIFont
fontWithDescriptor
:
descriptor
size
:
descriptor
.
pointSize
+
size
];
}
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment