diff --git a/Samples/MobileBuyIntegration/MobileBuyIntegration/AppDelegate.swift b/Samples/MobileBuyIntegration/MobileBuyIntegration/AppDelegate.swift index 0ddce2b3..01c5e56e 100644 --- a/Samples/MobileBuyIntegration/MobileBuyIntegration/AppDelegate.swift +++ b/Samples/MobileBuyIntegration/MobileBuyIntegration/AppDelegate.swift @@ -34,6 +34,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate { /// Enable preloading $0.preloading.enabled = true + + $0.title = "My Custom Title" } UIBarButtonItem.appearance().tintColor = .label diff --git a/Sources/ShopifyCheckout/CheckoutViewController.swift b/Sources/ShopifyCheckout/CheckoutViewController.swift index ffb17fe5..ec9e0ae5 100644 --- a/Sources/ShopifyCheckout/CheckoutViewController.swift +++ b/Sources/ShopifyCheckout/CheckoutViewController.swift @@ -23,6 +23,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SO import UIKit import WebKit +import Foundation class CheckoutViewController: UIViewController { @@ -58,10 +59,13 @@ class CheckoutViewController: UIViewController { super.init(nibName: nil, bundle: nil) - title = "Checkout" + title = ShopifyCheckout.configuration.title navigationItem.rightBarButtonItem = closeBarButtonItem + let deviceLanguage = Locale.preferredLanguages.first + print("Device language: \(deviceLanguage ?? "Unknown")") + checkoutView.viewDelegate = self } diff --git a/Sources/ShopifyCheckout/Configuration.swift b/Sources/ShopifyCheckout/Configuration.swift index 64954013..b350cb96 100644 --- a/Sources/ShopifyCheckout/Configuration.swift +++ b/Sources/ShopifyCheckout/Configuration.swift @@ -41,6 +41,8 @@ public struct Configuration { public var spinnerColor: UIColor = UIColor(red: 0.09, green: 0.45, blue: 0.69, alpha: 1.00) + public var title = "Checkout" + } extension Configuration {