Questions tagged [swift-package]

103 questions
1
vote
0 answers

XCode - Adding Local swift packages in the application target using xcconfig file

I have a white-label project which has multiple app targets. All the target use the common code and their specific assets. All the common code is divided into Core Modules and Feature Modules. All of these modules are Local Swift packages in the…
1
vote
0 answers

App using Swift package with binary dependencies Builds but does not run

I am wrapping the XCFramework of Google Places SDK for iOS as a Swift Package. Then I am trying to use this Swift Package in an iOS application. Here is where I downloaded Google Places XCFramework:…
Dogahe
  • 1,380
  • 2
  • 20
  • 50
1
vote
1 answer

Working with SwiftUI views and StateObject in packages

I created a SwiftUI view and ObservableObject in a package like this one: struct CustomView: View { @StateObject var viewModel: CustomViewModel var body: some View { Text("Test") } } class CustomViewModel:…
Janevin
  • 63
  • 4
1
vote
0 answers

Swift package error while importing firebase as a dependency

I am creating a custom swift package that depends on firebase. I followed different tutorial but I struggling with an error. This is my package description: import PackageDescription let package = Package( name: "FirebaseAuthManagment", …
carlo97
  • 169
  • 1
  • 3
  • 12
1
vote
1 answer

How do I make a swift package available for the Linux platform?

I'm building a Swift package which should work for MacOS and Linux. I have tried specifying the platform like so: let package = Package( name: "MyPackage", platforms: [ .macOS, .linux ], ... However I get this error: |…
sak
  • 2,612
  • 24
  • 55
1
vote
1 answer

Turn Package.swift file into binary XCFramework

Someone in my company created a Swift package SDK and now I was tasked to publish it for the customer in a binary way so that the end customers that will use the SDK will not be able to see the source code of it. This is how the SDK is built: the…
1
vote
1 answer

I added Objective-C files to Swift package via modulemap file, but implementation wasn't connected

I have a Swift package, and try to add Objective-c files. My package now: Root - Package.swift + Sources + ObjC + DataDeflate - DataDeflate.h - module.modulemap - NSData+Deflate.h - NSData+Deflate.m + Swift +…
General Failure
  • 2,421
  • 4
  • 23
  • 49
1
vote
0 answers

How to do top-of-tree development with Swift Package Manager and XCode?

So I am working on two packages in tandem, where Package A depends on Package B. Package A -> Package B Each package is in a separate git repository, and I would like to avoid having to push changes from Package B to remote every time I make a…
sak
  • 2,612
  • 24
  • 55
1
vote
0 answers

Import Swift Packages in Visual Studio Code

Im new with Swift and its tools. I use this extension. I added a package to dependencies but when I try to import my package import SwiftyJSON terminal gives me an error: error: no such module 'SwiftyJSON' import SwiftyJSON ^ My…
1
vote
0 answers

How do I make packages without version numbers work in Swift Playgrounds on the iPad?

I‘m trying to import the Swift package https://github.com/demharusnam/SwiftUIDrag into the playgrounds app on the iPad, but it won‘t work. I suspect it might have something to do with missing version tags, but I‘m new to git and thus don’t know how…
Ratramnus
  • 21
  • 4
1
vote
0 answers

Is there a way to set global settings for all Swift Package Manager dependencies?

I added GoogleSignIn with SPM however, I get 2 warnings (See attached). I know that the issue has to do with the values set on the Package.swift file of the dependency. I have been browsing around to find a way to fix the issue but, I have yet to…
JLico
  • 27
  • 1
  • 7
1
vote
0 answers

Xcodebuild failure for project with dependency on the Swift Collections package

I have a Swift project which has a dependency on Apple's Swift Collections package. I've added the package to the project and everything works fine when building from Xcode (for both Debug and Release). But when I try to build from the command line…
closetCoder
  • 1,064
  • 10
  • 21
1
vote
1 answer

C++ Check if the package has been installed via Swift Package Manager and include a file

I have a set of C++ packages resolved with the Swift Package Manager and another Package Manager (let's call it PMX). PMX cannot resolve one of the dependencies, but I have to run CI on it. Is it possible to somehow check that the package is being…
1
vote
2 answers

URLSession async not working in Swift Package

I'm trying to make an asynchronous network call using the async / await in Swift 5.5 but for some reason, it does not work as expected in my Swift Package. let (data, response) = await URLSession.shared.data(for: request) The above line of code…
Sabesh Bharathi
  • 171
  • 1
  • 9
1
vote
0 answers

How can I include/bundle other Swift Package dependencies in a Swift Package that only contains binaryTargets (XCFrameworks)?

I am creating Swift Packages from various Objective-C Frameworks (via use of XCFrameworks). I successfully created the SPs, but have run into an issue when it comes to the other SP dependencies it relies on. If I only add the WrapperPackage to my…