124 questions
Advice
1
vote
5
replies
79
views
How to wrap C-library into SwiftPackage to use in my project?
I created test project - "TaoTester" and test package with C-library called "SwiftGit2".
After few days of work in package almost all works fine....
EXCEPT: I cannot link C-...
0
votes
0
answers
38
views
Automatically add string from swift package to apps string catalog
I have a String Catalog file in the iOS app. If I have e.g. a Text("Hello App") in a view in the app, everything is automatically recognized and the key "Hello App" is added to the ...
1
vote
0
answers
31
views
Is there a way to provide Info.plist-based permissions when testing a Swift Package?
Is there a way to “give permission” to a package’s tests (or trigger the user permission dialog), so I can run tests in the package, without having to embed it in an app?
I want to pull some code out ...
1
vote
0
answers
34
views
Does Swift Packages have a similar feature to the "Private Module Map File" build setting?
I have seen a few projects where there is a import Module and a import Module.Internal.
If I open them up and build them I can see that the built .framework file in the Modules/ folder has both module....
2
votes
0
answers
144
views
Which UTType initialiser should I use if I don't know if the UTType is exported or imported?
I have two macOS apps - App A reads and writes documents of the type identifier com.example.custom-document, whereas App B only produces com.example.custom-document documents as an "Export" ...
1
vote
0
answers
59
views
How to make a Swift package for a C library imported from Homebrew
The frustrating thing is there are so many related questions that almost help me, but not the exact combination I'm doing.
This is my first time trying to make a Swift package wrapping a C library ...
0
votes
0
answers
64
views
How can I enhance my SwiftUI “SwipeCardUI” package to replicate Tinder-like swipe gestures and animations?
Background
I’ve been developing an open-source SwiftUI package called SwipeCardUI that provides a basic card-swipe interface. It allows users to drag cards left or right and triggers an action once ...
0
votes
1
answer
392
views
Error when running Previews in a Swift Package: XCPreviewAgent crashed because "Testing.framework" is missing
I moved all of my snapshot dependencies and some utility code that simplified my testing to a separate Package, so I didn't need to import all of my snapshots dependencies in every Package I wanted to ...
0
votes
0
answers
143
views
Not able to add MSAL library by using Swift Package
I am trying to add MSAL library
https://github.com/AzureAD/microsoft-authentication-library-common-for-objc by using Swift Package but getting below error message. Not sure how to resolve it.
I don’t ...
0
votes
1
answer
228
views
How do I fix this error of "not found in scope" when my classes are public with swift package manager?
I'm writting my first package for an XCode project I'm doing. I made the class inside of my package public. I import the package into my xcode project and then I try to call the class and it can't be ...
0
votes
0
answers
133
views
How can I make all my Swift Package Manager package optional like Firebase offers
I have a mono cocoapods repo, that host all our libraries. I'm in the process of adding support for Apple SPM. Everything is working on the package.swift configuration. But, I trying to have the same ...
1
vote
1
answer
376
views
Publishing and Consuming swift Artifacts as package dependencies in xcode project
I have a package repository on aws azure (a swift package name lets say SimplePackage)
I have created a repository in Code Artifacts section name (artifactsRepo)
Now I have followed Configure Swift ...
1
vote
0
answers
660
views
Is there any way to specify a minimum version in a Swift Package just for one platform without overriding the compatibility with other platforms?
I am working on a Swift Package and I want to add a NLLanguageRecognizer instance, which is only available in macOS 10.14+. At this point the other default minimums for Swift Packages are fine; Xcode ...
4
votes
2
answers
509
views
Cannot delete files from a Swift Package in Xcode
I've created a new Swift Package to store all classes from an SDK I'm developing. The idea is to reuse that Swift Package between other projects.
I've added the package to my current Xcode project by ...
0
votes
0
answers
33
views
Git - How to merge main branch to child branch if all files directories have been totally changed (wrapped in SPM)
I have a situation in my Swift iOS development project.
20 days ago, I created a branch named Modular_Approach from the Main-Branch. It's an enterprise application, so it took quite a while to convert ...
2
votes
5
answers
4k
views
Xcode "Missing package product 'GoogleUtilities_UserDefaults'" after updating to latest package version using SPM
A few days ago I updated the packages in my swift project to newer versions. I am using the Firebase SDK as well as a few others. Immediately after updating, I got a "Missing package product '...
1
vote
1
answer
120
views
SceneKit: Loading .scnassets inside a Swift Package
I have a shared SceneView that I should show it directly on iPad and show in a seperate window on macOS if it's requested by the user.
So, I decided to have SceneView and it's assets inside a Swift ...
0
votes
1
answer
1k
views
Xcode not updating Package to latest version, despite correct pushes and tags
I have a Swift package in our Github repo, which has been updated, newly tagged, and pushed. In Github everything shows to be in the correct state (i.e. the updated code is correct).
However, I cannot ...
1
vote
0
answers
355
views
Swift macro declaration not available in scope
I have a Swift Macro that does the following:
assertMacroExpansion(
#"""
struct MyStruct { var count: Int }
let obj = MyStruct(count: 42)
#destr(obj, \.count)
"&...
0
votes
1
answer
454
views
How to prevent Xcode compiling a package for a target which is not designated?
I am building a package that contains a lot of classes, extensions and modules I have been building since I started developing for iOS in 2008.
Because I also develop for macOS, watchOS, iPadOS, and ...
3
votes
1
answer
726
views
Xcode Cloud Errors Building Local SPMs that Work Locally "an out-of-date resolved file was detected"
Have added 2 Swift packages locally. (GraphQL code gens for Swift using Apollo iOS SDK v1.9.0). I'm using Xcode to manage the Swift packages. They've been added to the Project > Package ...
1
vote
1
answer
3k
views
Xcode error 'can not resolve package dependency graph' when overriding a dependency with a local package for package editing
I have an Xcode project with a package dependency and want to add that package dependency locally for editing within my app project, but Xcode reports an error when trying to add the package locally.
...
5
votes
1
answer
2k
views
String Catalog doesn't work with Swift Package
Can't make the new String Catalog work with my Swift Package (command line app)
Here is my Package.swift
// swift-tools-version:5.9
import PackageDescription
let package = Package(
name: "...
-1
votes
1
answer
682
views
Why is the *Delete* option grayed out for my package dependency in xcode?
Xcode version: 15.2 (15C500b)
I've looked around in various screens in Xcode but have not seen any way to delete a package dependency. Some StackOverflow posts mention the screen option Swift Packages ...
2
votes
1
answer
1k
views
In Xcode, how do you set compiler flags for standalone module (framework)?
I was writing my own standalone module and wanted to use cblas_dasum for efficient calculation of the sum of absolute values of a double array. Though a message pops up saying that I have to
specify ...
2
votes
1
answer
521
views
Adding a package to an iOS app extension Xcode
How can I add a package dependency that's already added to my main app to an app extension (for example a WidgetKit extension)?
I searched for this answer for a while, so it might save people some ...
0
votes
2
answers
63
views
Swift Packages say missing but are all listed - opening project on new MacBook
I opened my project for the first time on my new MacBook and it won't run. I am getting a bunch of errors about my packages. Github is signed in, derived data deleted, restarted, build cleaned, and ...
2
votes
1
answer
95
views
How to Create a Version-Independent and Scheme-Agnostic Build Script for Swift Package using Xcode and Swift Build?
Consider the following code to verify the compilation of some swift package (for the Swift Package Manager)
xcodebuild \
-scheme name-Package \
-sdk iphonesimulator \
-destination 'platform=iOS ...
0
votes
1
answer
136
views
How to introduce local private swfit package in the project in Xcode, just like sample app of Backyard Birds
If you check the screenshot of Apple sample project of Backyard Birds, it has three Swift Packages which is local and private to the project only. Also, there is no Sources folder like other normal ...
0
votes
1
answer
719
views
Add a Swift Package to a workspace in a script
I can create a new Swift Package in Xcode and able to add it in a workspace.
This can be done using Xcode -> File -> New Package, add the name and select the workspace in "Add to" and ...
4
votes
0
answers
350
views
swift package show-dependencies for Xcode Project
I have a large Xcode project that has many SPM dependencies. I'm getting an error:
multiple products named 'Swinject' in:
'github.com--swinject--swinject', 'github.com-swinject-swinject'
This error ...
3
votes
1
answer
1k
views
Swift Package Manager: dependency rules: "from" vs "upToNextMajor"
Let's consider a common format of listing a dependency inside the package:
.package(url: "ssh://[email protected]:firm/repo.git", from: "1.1.0"),
And this format:
.package(url: &...
0
votes
1
answer
446
views
Adding third party dependancy in swift package manager issues
I have created swift package manager. In that i have to add third party package
https://github.com/danielgindi/Charts. I have added that package as dependancy in Package.swift file. It has been added ...
2
votes
0
answers
191
views
Can I define my binary framework which has open source dependencies without specifying the 'type' parameter in each of my framework's dependencies?
I'm having a problem defining the Package.swift file for my binary closed-source dynamic framework which depends on a number of non-binary open-source dynamic frameworks.
My Package.swift file looks ...
1
vote
1
answer
465
views
Sharing a Resources.bundle bundle with a Binary Target on Swift Package Manager
I'm trying to distribute an XCFramework for some internal iOS apps using Swift Package Manager. This is a third-party library that constitutes:
The one XCFramework
A Resources.bundle file
The SPM ...
0
votes
0
answers
208
views
Strange error while using Swift Package OpenSSL (code signing a Swift Package?)
I have added the Swift Package OpenSSL to my project.
When I run the app, it crashes with this error
/Users/myself/Library/Developer/Xcode/DerivedData/MyApp-axyxgyhzyndlrqbybswlbgbcdcqd/Build/Products/...
3
votes
1
answer
83
views
Naming conflict with the Swift StreamVideo SDK
How can I solve a naming conflict between e.g. a local User object and the same object name in the StreamVideo SDK?
Regular imports can lead to problems with existing project files that have the same ...
1
vote
0
answers
436
views
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:...
0
votes
2
answers
2k
views
How do I exclude SwiftUI Previews from code coverage in Swift packages?
I have found solutions explaining how to exclude code coverage for SwiftUI projects, but I have failed to find anything for SwiftUI Packages. My Swift package includes views (and previews) for use in ...
0
votes
2
answers
833
views
How to debug and build a swift package from a project and why public classes inside the package are still not seen?
I have created a swift package that compiled fine.
I have imported the swift package in a project.
No class inside the package is seen on the project. So I made them public.
I added public init() {} ...
1
vote
1
answer
384
views
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 ...
0
votes
0
answers
369
views
Can framework include another framework as a dependency?
I am building a new UI framework, let's call it a framework2, there is already existing UI framework framework1, unfortunately can not add or make more changes to that framework1(Provide by a vendor, ...
0
votes
1
answer
58
views
how I can make xcode access my table in my API through a swiftPackage?
I have a database (PostgreSQL) with data, I've create an API (apinetopark) (with vapor) and an app netopark(macOS,swiftUI).
My API successfully (localhost) reach the database and return my data. So I ...
3
votes
2
answers
454
views
Swift package C header errors
My C library compiles and gets packaged into an xcframework without a problem, but my Swift project that uses this through a Swift Package then has some errors...
Namely, I'm getting
Token is not a ...
1
vote
0
answers
320
views
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 ...
0
votes
1
answer
865
views
Error message: "Type 'any ViewModifier' cannot conform to 'ViewModifier'"
At the moment I try to create a package with SwiftUI. I created a ProfileImageView. I get an Url as an optional String, which I convert to a non-optional String with if...let... In the body I use this ...
5
votes
0
answers
1k
views
The package product 'SwiftSyntaxMacros' requires minimum platform version 10.15 for the macOS platform, but this target supports 10.13
I created a new swift macro package in my Xcode project.
My Package.swift looks like:
import CompilerPluginSupport
import PackageDescription
let package = Package(
name: "TestMockable",
...
1
vote
0
answers
125
views
Can not import dependency of Google-Mobile-Ad in my swift package
I want to make a package of google-mobile-ads to use on multiple devices.But the issue is I can not import or add the dependency of google-mobile-ads in my swift package.
How I can do this?
1
vote
1
answer
61
views
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 ...
3
votes
1
answer
1k
views
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 ...