diff --git a/VDS/Components/Icon/IconName.swift b/VDS/Components/Icon/IconName.swift index c2d5076b..1234df63 100644 --- a/VDS/Components/Icon/IconName.swift +++ b/VDS/Components/Icon/IconName.swift @@ -48,7 +48,6 @@ extension Icon { internal static let paginationRightCaret = Name(name: "pagination-right-caret") internal static let verizonUp = Name(name: "verizon-up") internal static let warningBold = Name(name: "warning-bold") - public static let checkmark = Name(name: "checkmark") public static let checkmarkAlt = Name(name: "checkmark-alt") public static let close = Name(name: "close") diff --git a/VDS/Components/Pagination/PaginationButton.swift b/VDS/Components/Pagination/PaginationButton.swift index 4ed851b5..290bbef5 100644 --- a/VDS/Components/Pagination/PaginationButton.swift +++ b/VDS/Components/Pagination/PaginationButton.swift @@ -73,8 +73,9 @@ open class PaginationButton: ButtonBase { /// Used to make changes to the View based off a change events or from local properties. open override func updateView() { text = type.title - setImage(type.image, for: .normal) - tintColor = buttonTintColorConfiguration.getColor(surface) + let color = buttonTintColorConfiguration.getColor(surface) + setImage(type.image(color), for: .normal) + tintColor = color super.updateView() } } @@ -94,13 +95,16 @@ extension PaginationButton { "Previous" } } + + private var imageSize: CGSize { Icon.Size.xsmall.dimensions } + ///Image for the configuration type - var image: UIImage? { + func image(_ color: UIColor) -> UIImage? { switch self { case .previous: - BundleManager.shared.image(for: "pagination-arrow-left")?.withRenderingMode(.alwaysTemplate) + UIImage.image(for: .paginationLeftArrow, color: color, renderingMode: .alwaysTemplate)?.resized(to: imageSize) case .next: - BundleManager.shared.image(for: "pagination-arrow-right")?.withRenderingMode(.alwaysTemplate) + UIImage.image(for: .paginationRightArrow, color: color, renderingMode: .alwaysTemplate)?.resized(to: imageSize) } } } diff --git a/VDS/Extensions/UIImage+Helper.swift b/VDS/Extensions/UIImage+Helper.swift index c8f103dc..41f25a42 100644 --- a/VDS/Extensions/UIImage+Helper.swift +++ b/VDS/Extensions/UIImage+Helper.swift @@ -23,4 +23,17 @@ extension UIImage { return image.withTintColor(color, renderingMode: renderingMode) } + + /// Resizes image to a specific Size + /// - Parameter size: Size to resize + /// - Returns: Image that is resized + public func resized(to size: CGSize) -> UIImage? { + UIGraphicsBeginImageContextWithOptions(size, false, 0.0) + + defer { UIGraphicsEndImageContext() } + draw(in: .init(origin: .zero, size: size)) + + return UIGraphicsGetImageFromCurrentImageContext() + } + } diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-left.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-left.imageset/Contents.json deleted file mode 100644 index 6c37b40d..00000000 --- a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-left.imageset/Contents.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "images" : [ - { - "filename" : "pagination-arrow-left.svg", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-left.imageset/pagination-arrow-left.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-left.imageset/pagination-arrow-left.svg deleted file mode 100644 index a8c85c97..00000000 --- a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-left.imageset/pagination-arrow-left.svg +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-right.imageset/Contents.json b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-right.imageset/Contents.json deleted file mode 100644 index d294d555..00000000 --- a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-right.imageset/Contents.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "images" : [ - { - "filename" : "pagination-arrow-right.svg", - "idiom" : "universal" - } - ], - "info" : { - "author" : "xcode", - "version" : 1 - } -} diff --git a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-right.imageset/pagination-arrow-right.svg b/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-right.imageset/pagination-arrow-right.svg deleted file mode 100644 index be02bedf..00000000 --- a/VDS/SupportingFiles/Icons.xcassets/Restricted/pagination-arrow-right.imageset/pagination-arrow-right.svg +++ /dev/null @@ -1,3 +0,0 @@ - - -