From eb7c4514b5132f0af6f3e38f64d2080d299777ae Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Fri, 20 Oct 2023 17:37:49 +0100 Subject: [PATCH] Make the X icon smaller --- Sources/ShopifyCheckout/CheckoutViewController.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Sources/ShopifyCheckout/CheckoutViewController.swift b/Sources/ShopifyCheckout/CheckoutViewController.swift index 4326e192..8cbb2f91 100644 --- a/Sources/ShopifyCheckout/CheckoutViewController.swift +++ b/Sources/ShopifyCheckout/CheckoutViewController.swift @@ -45,13 +45,16 @@ class CheckoutViewController: UIViewController, UIAdaptivePresentationController private lazy var closeBarButtonItem: UIBarButtonItem = { switch ShopifyCheckout.configuration.colorScheme { case .web: - return UIBarButtonItem( - barButtonSystemItem: .stop, target: self, action: #selector(close) - ) + let closeIcon = UIImage(systemName: "xmark")? + .withConfiguration(UIImage.SymbolConfiguration(pointSize: 14, weight: .regular)) + .withTintColor(.white, renderingMode: .alwaysOriginal) + let closeBarButtonItem = UIBarButtonItem(image: closeIcon, style: .plain, target: self, action: #selector(close)) + return closeBarButtonItem default: - return UIBarButtonItem( + let closeIcon = UIBarButtonItem( barButtonSystemItem: .close, target: self, action: #selector(close) ) + return closeIcon } }()