Assets in spm

Add assets to SPM Only for Swift tools version of 5.3 or later


In the Package.swift

targets: [
        name: "MyLibrary", //  consider using a subfolder for resources to distinguish them from source files,  For example, put all resource files into a directory named Resources, resulting in all of your resource files residing at Sources/MyLibrary/Resources.
        resources: [

In the code:

let settingsURL = Bundle.module.url(forResource: "settings", withExtension: "plist")


  • You can set folder paths and file paths as resources


  • General SPM assets:
  • Localizing spm assets:
  • Binary distro:
  • Local spm modules:
  • Bundle.module for mac: