Skip to content

Commit

Permalink
Allow title to be configured by merchants
Browse files Browse the repository at this point in the history
  • Loading branch information
markmur committed Oct 19, 2023
1 parent f43dc47 commit 4fbac51
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

/// Enable preloading
$0.preloading.enabled = true

$0.title = "My Custom Title"
}

UIBarButtonItem.appearance().tintColor = .label
Expand Down
6 changes: 5 additions & 1 deletion Sources/ShopifyCheckout/CheckoutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 2 additions & 0 deletions Sources/ShopifyCheckout/Configuration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 4fbac51

Please sign in to comment.