Relative Content

Tag Archive for swiftxcodemacosimageswift-package-manager

SwiftPM executable target – assets work from Xcode but not the command-line

Context Consider a simple Swift Package with a MyLibrary and MyExecutable target. The aim is for MyExecutable to use MyLibrary (which has an image). The MyLibrary target has 2 files, a Resources/Assets.xcassets catalog (with 1 image named “Test”) and an Images.swift file like so: private extension NSImage { static let test = Bundle.module.image(forResource: “Test”) } […]

SwiftPM executable target – assets work from Xcode but not the command-line

Context Consider a simple Swift Package with a MyLibrary and MyExecutable target. The aim is for MyExecutable to use MyLibrary (which has an image). The MyLibrary target has 2 files, a Resources/Assets.xcassets catalog (with 1 image named “Test”) and an Images.swift file like so: private extension NSImage { static let test = Bundle.module.image(forResource: “Test”) } […]

SwiftPM executable target – assets work from Xcode but not the command-line

Context Consider a simple Swift Package with a MyLibrary and MyExecutable target. The aim is for MyExecutable to use MyLibrary (which has an image). The MyLibrary target has 2 files, a Resources/Assets.xcassets catalog (with 1 image named “Test”) and an Images.swift file like so: private extension NSImage { static let test = Bundle.module.image(forResource: “Test”) } […]

SwiftPM executable target – assets work from Xcode but not the command-line

Context Consider a simple Swift Package with a MyLibrary and MyExecutable target. The aim is for MyExecutable to use MyLibrary (which has an image). The MyLibrary target has 2 files, a Resources/Assets.xcassets catalog (with 1 image named “Test”) and an Images.swift file like so: private extension NSImage { static let test = Bundle.module.image(forResource: “Test”) } […]

SwiftPM executable target – assets work from Xcode but not the command-line

Context Consider a simple Swift Package with a MyLibrary and MyExecutable target. The aim is for MyExecutable to use MyLibrary (which has an image). The MyLibrary target has 2 files, a Resources/Assets.xcassets catalog (with 1 image named “Test”) and an Images.swift file like so: private extension NSImage { static let test = Bundle.module.image(forResource: “Test”) } […]

SwiftPM executable target – assets work from Xcode but not the command-line

Context Consider a simple Swift Package with a MyLibrary and MyExecutable target. The aim is for MyExecutable to use MyLibrary (which has an image). The MyLibrary target has 2 files, a Resources/Assets.xcassets catalog (with 1 image named “Test”) and an Images.swift file like so: private extension NSImage { static let test = Bundle.module.image(forResource: “Test”) } […]

SwiftPM executable target – assets work from Xcode but not the command-line

Context Consider a simple Swift Package with a MyLibrary and MyExecutable target. The aim is for MyExecutable to use MyLibrary (which has an image). The MyLibrary target has 2 files, a Resources/Assets.xcassets catalog (with 1 image named “Test”) and an Images.swift file like so: private extension NSImage { static let test = Bundle.module.image(forResource: “Test”) } […]

SwiftPM executable target – assets work from Xcode but not the command-line

Context Consider a simple Swift Package with a MyLibrary and MyExecutable target. The aim is for MyExecutable to use MyLibrary (which has an image). The MyLibrary target has 2 files, a Resources/Assets.xcassets catalog (with 1 image named “Test”) and an Images.swift file like so: private extension NSImage { static let test = Bundle.module.image(forResource: “Test”) } […]

SPM executable target – assets work from Xcode but not the command-line

Context Consider a simple Swift Package with a MyLibrary and MyExecutable target. The aim is for the MyExecutable to call upon MyLibrary (which has an image). The MyLibrary target has 2 files, a Resources/Assets.xcassets catalog (with 1 image named “Test”) and an Images.swift file (emphasis on Bundle.module usage here): private extension NSImage { static let […]