From 0a9d2b358f1c1c01474864cf28dbe8533bfebf72 Mon Sep 17 00:00:00 2001 From: OS-pedrogustavobilro Date: Wed, 4 Feb 2026 12:57:15 +0000 Subject: [PATCH 1/3] fix(ios): bundle resources into Swift Package AI assisted with Claude Code References: https://outsystemsrd.atlassian.net/browse/RMET-4952 --- Package.swift | 5 ++++- .../Interface Elements/OSBARCTorchButton.swift | 15 ++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Package.swift b/Package.swift index ff81fee..e46863f 100644 --- a/Package.swift +++ b/Package.swift @@ -15,7 +15,10 @@ let package = Package( targets: [ .target( name: "OSBarcodeLib", - path: "Sources/OSBarcodeLib" + path: "Sources/OSBarcodeLib", + resources: [ + .process("Scanner/OSBARCScannerView.xcassets") + ] ), .testTarget( name: "OSBarcodeLibTests", diff --git a/Sources/OSBarcodeLib/Scanner/Interface Elements/OSBARCTorchButton.swift b/Sources/OSBarcodeLib/Scanner/Interface Elements/OSBARCTorchButton.swift index 990e7ed..d82fce1 100644 --- a/Sources/OSBarcodeLib/Scanner/Interface Elements/OSBARCTorchButton.swift +++ b/Sources/OSBarcodeLib/Scanner/Interface Elements/OSBARCTorchButton.swift @@ -27,7 +27,7 @@ struct OSBARCTorchButton: View { var body: some View { Button(action: action) { - Image(iconName, bundle: .init(for: OSBARCScannerBehaviour.self)) // xcassets item. + Image(iconName, bundle: Bundle.imageBundle) .frame(width: size, height: size) .background( Circle() @@ -42,3 +42,16 @@ struct OSBARCTorchButton: View { } } } + +// MARK: - Bundle Extension +private extension Bundle { + /// Returns the appropriate bundle for loading image assets. + /// Uses Bundle.module for SwiftPM and falls back to the class bundle for CocoaPods. + static var imageBundle: Bundle? { + #if SWIFT_PACKAGE + return Bundle.module + #else + return Bundle(for: OSBARCScannerBehaviour.self) + #endif + } +} From e6f8e4e88995a5e657480289670bec7ea876c954 Mon Sep 17 00:00:00 2001 From: OS-pedrogustavobilro Date: Wed, 4 Feb 2026 13:04:16 +0000 Subject: [PATCH 2/3] docs: Changelog entry --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb47a78..324c3e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Fix + +- Bundle missing resources into the Swift Package [RMET-4952](https://outsystemsrd.atlassian.net/browse/RMET-4952). + ## 2.1.0 ### Features From aa83a9d2f5fd1b29d929198cd94d2e611e91fe8f Mon Sep 17 00:00:00 2001 From: OS-pedrogustavobilro Date: Wed, 4 Feb 2026 13:40:46 +0000 Subject: [PATCH 3/3] ci: Use Xcode 26.2 So we don't have to download simulators --- .github/workflows/github_actions.yml | 2 +- .github/workflows/prepare_release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/github_actions.yml b/.github/workflows/github_actions.yml index 607f45c..09c03d7 100644 --- a/.github/workflows/github_actions.yml +++ b/.github/workflows/github_actions.yml @@ -22,7 +22,7 @@ jobs: run: brew link --overwrite swiftlint || brew install swiftlint - name: Set up XCode - run: sudo xcode-select --switch /Applications/Xcode_26.0.app + run: sudo xcode-select --switch /Applications/Xcode_26.2.app - name: Bundle Install run: bundle install diff --git a/.github/workflows/prepare_release.yml b/.github/workflows/prepare_release.yml index 4c4cca0..2d71cb2 100644 --- a/.github/workflows/prepare_release.yml +++ b/.github/workflows/prepare_release.yml @@ -25,7 +25,7 @@ jobs: run: brew link --overwrite swiftlint || brew install swiftlint - name: Set up XCode - run: sudo xcode-select --switch /Applications/Xcode_26.0.app + run: sudo xcode-select --switch /Applications/Xcode_26.2.app - name: Set up Ruby uses: ruby/setup-ruby@v1