Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/github_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
}
}
Loading