Questions tagged [swift-package]
103 questions
0
votes
1 answer
Build error for device with swift package dependency. Cannot open file handle for file at path: Path(str: "... .framework")
I'm trying to create a swift package from existing xcframework. I can add it to my test app but I get that error: "Cannot open file handle for file at path: Path(str: "... .framework")" when I'm trying to compile the app.
It happens for both device…

avrmglkp
- 1
- 3
0
votes
1 answer
How can I add headers to an XCFramework package?
I'm trying to wrap an XCFramework as a swift package. Following the documentation, I have created a package with the following directory structure:
/MyXCFPackage
/Package.swift
/MyXCFPackage.xcframework
/include <- some additional…

sak
- 2,612
- 24
- 55
0
votes
1 answer
Use the sysctlbyname function within a Linux Swift Package
i am trying to add linux support to my swift package library for system info, but i don't know how i can access the sysctlbyname function on linux within a Swift package.
For all of it's detections the library relies on the sysctlbyname function…

Pietro Caruso
- 49
- 6
0
votes
1 answer
Swift Package access modifiers
I created a simply Swift Package with one UI class in it.
I managed to upload to a repo and use it in a project.
First time when I tried to import it and use it in a main project there was a problem with access modifiers because my package was not…

poPaTheGuru
- 1,009
- 1
- 13
- 35
0
votes
0 answers
Trying to access CloudKit database with entitlements from inside swift package (tests)
I'm trying to refactor code from an app into a swift package and provide unit test coverage as I go.
When I try to access the CKDatabase in the unit tests it throws the following error...
The application is missing required value "CloudKit" in…

Mercutio
- 1,152
- 1
- 14
- 33
0
votes
1 answer
What is the proper syntax for accessing a function from ObjC to a Swift Package?
Simple Scenario: I want to call any Swift Package member function from within Objective-C.
I'm building a reference/demo/proof-of-concept app to mix ObjC with Swift.
Here's a working snippet from the Swift side:
import Foundation
import…

Frederick C. Lee
- 9,019
- 17
- 64
- 105
0
votes
0 answers
Split Swift package into two (or more) distinct imports
I am diving into dependency management with SPM, here is my Package.swift
let package = Package(
name: "MyPackage",
products: [
.library(
name: "MyPackage",
targets: ["MyPackage"]),
],
targets: [
…

Olympiloutre
- 2,268
- 3
- 28
- 38
0
votes
1 answer
Objective-C: multi-parameter method syntax into Swift Package's functions
Goal: to master the ObjC <--> Swift API syntax
Problem: Working with multi-parameter function API.
I haven't been doing ObjC in years and now I need to interface ObjC with Swift packages.
Here's the Swift-Package code:
import Foundation
public…

Frederick C. Lee
- 9,019
- 17
- 64
- 105
0
votes
2 answers
Objective-C accessing Swift Package functions
Goal: To use Swift Package within Objective-C.
All I'm trying to do is to have a simple, rudimentary understanding of the correct syntax of access Swift vars & func() from ObjC.
This is the second part of questions about using Objective-C with a…

Frederick C. Lee
- 9,019
- 17
- 64
- 105
0
votes
1 answer
What's the proper way to access a Swift Package item from Objective-C?
Scenario:
I had built a Swift <-- package simple App that is working.
Now I'm trying to convert this to a Objective-C <--- package app.
Question #1: How to I formally import the package?
I've read to use the '@import' vs the older '#import'.
Now…

Frederick C. Lee
- 9,019
- 17
- 64
- 105
-1
votes
1 answer
Xcode: SPM Package shows as No such module 'AsyncAlgorithms'
I'm trying to add the swift-async-algorithms package to my project using SPM. I add it the package:
I'm tried to import the package to my project:
Any of you knows how can I can fix this error?
I tried almost all the posible solitons in here but…

user2924482
- 8,380
- 23
- 89
- 173
-1
votes
1 answer
How to make a property only readable in a swift package while can be accessed outer of it?
I'm making a swift package using existing code to separate a class as a module from the main project.
My original code makes properties private(set), which is intended to make it only readable (not settable).
// Original code
// A property of the…

Yiming Designer
- 423
- 3
- 10