Questions tagged [swift-package]

103 questions
2
votes
0 answers

Accessing resources/assets of one package in another package in swiftui

I am working a project where I am modularising with Swift Packages. I have a package I called Theme where my Color and Image assets resides, under the Sources directory. In another package called Home, I would like to have access to the Assets in…
Darotudeen
  • 1,914
  • 4
  • 21
  • 36
2
votes
2 answers

How to use dependencies in a Swift Package

I created a new Package with Xcode and incorporated a dependency, however when I try to use it, I get an error. How do I use the dependency in the Package sources? In a normal project, I can easily import and use AgileDB. Here's the Package: //…
Aaron Bratcher
  • 6,051
  • 2
  • 39
  • 70
2
votes
0 answers

Swift Package Manager failed to resolve dependencies: artifacts already exists in file system. fatalError

I have uploaded my binary artifacts in maven-central repository. I am fetching these libraries through SPM. I am getting the below error most of the times. xcodebuild: error: Could not resolve package dependencies: failed downloading which is…
2
votes
2 answers

Swift Playground 4: Import Swift Package

I'm using Swift Playgrounds App on Mac, which is different than Swift Playgrounds inside the Xcode. I'm interested in using a UIKit-based Swift Package in my Playground, but couldn't find anything similar to Package.swift file or a menu item to add…
2
votes
1 answer

Swift Package Issue after updating to MacOS Monterey

I'm having this issue with my swift package. It was created a few weeks ago with BigSur, as the platform target i put iOS 15. I don't understand what it could be ld: warning: dylib…
2
votes
2 answers

How can I display SVG bundled inside a Swift Package?

I am trying to display an image bundle inside a Swift Package. This code let image = UIImage(named: "image", in: Bundle.module, compatibleWith: nil) works when I use png image. But when I use a svg with the same name (image.svg), the image is…
Peacemoon
  • 3,198
  • 4
  • 32
  • 56
1
vote
0 answers

Authenticate private Git repo in a swift package, How to refer the package specific .ssh directory?

I have implemented a package which has Private SPM dependencies, I am trying to authenticate the private Git repo with GitHub Deploy Key (SSH key), added dependency looks like below, dependencies: [ .package(url:…
Vishwa
  • 11
  • 2
1
vote
1 answer

Swift Playgrounds: Unable to Resolve Package ‘Graphics’ and ‘unzip’ Executable Not Found Error

When I import a package in Swift Playgrounds on my iPad, I receive the following error: This package interactions with libgit2, and it don’t have any release in the origin repository, so I find a existing fork which have release. Playgrounds…
1
vote
0 answers

Unable to initialize intent definition from remote Swift Package

I am building a remote package for home screen Widget. One of the things I needed to do is to add .intentdefinition file to the package. Because it seems like its not really what Apple expects you to do, I had to trigger and generate code for it…
Jared_M
  • 547
  • 1
  • 5
  • 13
1
vote
1 answer

Why is this value empty?

I have a custom class, located in a Swift Package, I am using as the super class to my AppDelegate When I run the following code, testVar will be empty when printed to the console. import UIKit import CustomSwiftPackage @main class AppDelegate:…
Michael
  • 9,639
  • 3
  • 64
  • 69
1
vote
1 answer

Swift Package with dependencies giving error in console

I am trying to create a Swift Package from a custom xcframework that I'm building for a client. The framework has a dependency on a couple of 3rd party frameworks. I've read about how even though binary frameworks don't support dependencies…
Z S
  • 7,039
  • 12
  • 53
  • 105
1
vote
1 answer

Cannot find type 'UITableView' in scope

I am using swift package in several projects. In one of them, this package stopped compiling with error "Cannot find type 'any UITableView related type ' in scope". I can't fix it by any action. I tried: Clean Build folder Reset Package Caches Readd…
Alexey
  • 79
  • 7
1
vote
0 answers

How to access module named lambda using amplify-swift sdk

I am developing a swift package with which I need to use aws lambda as well as cognito services. Inside the package when I include dependencies as dependencies: [ // Dependencies declare other packages that this package depends on. …
Neo
  • 936
  • 6
  • 17
1
vote
0 answers

I created a Swift Package and would like to include a function that returns both the name and the version of the package

I have a main app that will access multiple (self-created) Swift Packages. For a better user and tester experience I'd like to have a page that displays all Swift Package names and their respective version, however, these should be accessed…
1
vote
0 answers

Property from Objective-C class is not visible in Swift subclass when that property is from Swift Package

I have a class hierarchy like this: MySwiftSubViewController -> ViewController -> UIViewController. Here is the code: #import @class SwiftClassFromPackage; @interface ViewController : UIViewController @property (nonatomic, strong)…
iljer
  • 564
  • 6
  • 9