From a7ec97a2999928a076a19179b83df3992734cb29 Mon Sep 17 00:00:00 2001 From: Bryan Gonzales <ronald.gonzales@autodesk.com> Date: Mon, 12 Aug 2024 17:06:16 -0500 Subject: [PATCH 1/7] Test change --- Sources/Controllers/CameraHeaderViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Controllers/CameraHeaderViewController.swift b/Sources/Controllers/CameraHeaderViewController.swift index 6a8a37b..b9b863d 100644 --- a/Sources/Controllers/CameraHeaderViewController.swift +++ b/Sources/Controllers/CameraHeaderViewController.swift @@ -27,7 +27,7 @@ public final class CameraHeaderViewController: UIViewController { public override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .clear - titleLabel = makeLabel(text: localizedString("SCAN_TITLE")) + titleLabel = makeLabel(text: "Scanner") barcodeLabel = makeLabel(text: localizedString("SCAN_BARCODE_SUBTITLE")) qrLabel = makeLabel(text: localizedString("SCAN_QRCODE_SUBTITLE")) barcodeImageView = makeImageView(imageName: "barcode") From 6ba73e3ad7ced2f6d043b873801b5641c4dde017 Mon Sep 17 00:00:00 2001 From: Bryan Gonzales <ronald.gonzales@autodesk.com> Date: Mon, 12 Aug 2024 21:06:11 -0500 Subject: [PATCH 2/7] Test Localizer bundle --- Sources/Helpers/Functions.swift | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Sources/Helpers/Functions.swift b/Sources/Helpers/Functions.swift index cd5d0e9..5d8e4a2 100644 --- a/Sources/Helpers/Functions.swift +++ b/Sources/Helpers/Functions.swift @@ -28,11 +28,8 @@ func imageNamed(_ name: String) -> UIImage { - Returns: An image. */ func localizedString(_ key: String) -> String { - if let path = Bundle(for: BarcodeScannerViewController.self).resourcePath, - let resourceBundle = Bundle(path: path + "/Localization.bundle") { - return resourceBundle.localizedString(forKey: key, value: nil, table: "Localizable") - } - return key + let moduleBundle: Bundle! = Bundle(identifier: "com.loupe.PlanGrid.Localizer") + return NSLocalizedString(key, bundle: moduleBundle, comment: "") } /// Checks if the app is running in Simulator. From 8dd1e3495eb9a46148f5184e7986b6e8a57084c8 Mon Sep 17 00:00:00 2001 From: Bryan Gonzales <ronald.gonzales@autodesk.com> Date: Mon, 12 Aug 2024 21:13:12 -0500 Subject: [PATCH 3/7] Revert "Test Localizer bundle" This reverts commit 6ba73e3ad7ced2f6d043b873801b5641c4dde017. --- Sources/Helpers/Functions.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Sources/Helpers/Functions.swift b/Sources/Helpers/Functions.swift index 5d8e4a2..cd5d0e9 100644 --- a/Sources/Helpers/Functions.swift +++ b/Sources/Helpers/Functions.swift @@ -28,8 +28,11 @@ func imageNamed(_ name: String) -> UIImage { - Returns: An image. */ func localizedString(_ key: String) -> String { - let moduleBundle: Bundle! = Bundle(identifier: "com.loupe.PlanGrid.Localizer") - return NSLocalizedString(key, bundle: moduleBundle, comment: "") + if let path = Bundle(for: BarcodeScannerViewController.self).resourcePath, + let resourceBundle = Bundle(path: path + "/Localization.bundle") { + return resourceBundle.localizedString(forKey: key, value: nil, table: "Localizable") + } + return key } /// Checks if the app is running in Simulator. From 59f25df7d8fe33350bf40fae29a452550cb1f295 Mon Sep 17 00:00:00 2001 From: Bryan Gonzales <ronald.gonzales@autodesk.com> Date: Mon, 12 Aug 2024 21:16:46 -0500 Subject: [PATCH 4/7] Update Bundle.module --- Sources/Helpers/Functions.swift | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Sources/Helpers/Functions.swift b/Sources/Helpers/Functions.swift index cd5d0e9..ed9fbad 100644 --- a/Sources/Helpers/Functions.swift +++ b/Sources/Helpers/Functions.swift @@ -28,11 +28,7 @@ func imageNamed(_ name: String) -> UIImage { - Returns: An image. */ func localizedString(_ key: String) -> String { - if let path = Bundle(for: BarcodeScannerViewController.self).resourcePath, - let resourceBundle = Bundle(path: path + "/Localization.bundle") { - return resourceBundle.localizedString(forKey: key, value: nil, table: "Localizable") - } - return key + return Bundle.module.localizedString(forKey: key, value: nil, table: "Localizable") } /// Checks if the app is running in Simulator. From b31621897bbcaa52398a3baaf5d64b5abb1853c6 Mon Sep 17 00:00:00 2001 From: Bryan Gonzales <ronald.gonzales@autodesk.com> Date: Mon, 12 Aug 2024 21:32:06 -0500 Subject: [PATCH 5/7] Update image bundle --- Sources/Controllers/CameraHeaderViewController.swift | 2 +- Sources/Helpers/Functions.swift | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/Sources/Controllers/CameraHeaderViewController.swift b/Sources/Controllers/CameraHeaderViewController.swift index b9b863d..6a8a37b 100644 --- a/Sources/Controllers/CameraHeaderViewController.swift +++ b/Sources/Controllers/CameraHeaderViewController.swift @@ -27,7 +27,7 @@ public final class CameraHeaderViewController: UIViewController { public override func viewDidLoad() { super.viewDidLoad() view.backgroundColor = .clear - titleLabel = makeLabel(text: "Scanner") + titleLabel = makeLabel(text: localizedString("SCAN_TITLE")) barcodeLabel = makeLabel(text: localizedString("SCAN_BARCODE_SUBTITLE")) qrLabel = makeLabel(text: localizedString("SCAN_QRCODE_SUBTITLE")) barcodeImageView = makeImageView(imageName: "barcode") diff --git a/Sources/Helpers/Functions.swift b/Sources/Helpers/Functions.swift index ed9fbad..5b95823 100644 --- a/Sources/Helpers/Functions.swift +++ b/Sources/Helpers/Functions.swift @@ -7,15 +7,9 @@ import AVFoundation - Returns: An image. */ func imageNamed(_ name: String) -> UIImage { - let cls = BarcodeScannerViewController.self - var bundle = Bundle(for: cls) let traitCollection = UITraitCollection(displayScale: 3) - if let resourceBundle = bundle.resourcePath.flatMap({ Bundle(path: $0 + "/BarcodeScanner.bundle") }) { - bundle = resourceBundle - } - - guard let image = UIImage(named: name, in: bundle, compatibleWith: traitCollection) else { + guard let image = UIImage(named: name, in: Bundle.module, compatibleWith: traitCollection) else { return UIImage() } From 3502736c3fc6bd3051cf701f0b4ed211f656e229 Mon Sep 17 00:00:00 2001 From: Bryan Gonzales <ronald.gonzales@autodesk.com> Date: Thu, 15 Aug 2024 21:54:30 -0500 Subject: [PATCH 6/7] Bump version --- BarcodeScanner.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BarcodeScanner.podspec b/BarcodeScanner.podspec index 35c6eec..05c7e0d 100644 --- a/BarcodeScanner.podspec +++ b/BarcodeScanner.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "BarcodeScanner" s.summary = "Simple and beautiful barcode scanner." - s.version = "5.1.0" + s.version = "5.1.1" s.homepage = "https://github.com/hyperoslo/BarcodeScanner" s.license = 'MIT' s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" } From f89dbd4ba17a17bcd18ecd29ecdb203a55a39366 Mon Sep 17 00:00:00 2001 From: Bryan Gonzales <ronald.gonzales@autodesk.com> Date: Mon, 19 Aug 2024 11:07:08 -0500 Subject: [PATCH 7/7] Undo podspec bump version --- BarcodeScanner.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BarcodeScanner.podspec b/BarcodeScanner.podspec index 05c7e0d..35c6eec 100644 --- a/BarcodeScanner.podspec +++ b/BarcodeScanner.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "BarcodeScanner" s.summary = "Simple and beautiful barcode scanner." - s.version = "5.1.1" + s.version = "5.1.0" s.homepage = "https://github.com/hyperoslo/BarcodeScanner" s.license = 'MIT' s.author = { "Hyper Interaktiv AS" => "ios@hyper.no" }