124 questions
0
votes
1
answer
369
views
Remove google maps and keep google places package ios
I have my SwiftUI app where I am only using import GooglePlaces.
To use Google Places I had to install the package from: https://github.com/YAtechnologies/GoogleMaps-SP
The problem is that when I am ...
4
votes
1
answer
1k
views
Unable to build a Swift package after adding the `RxSwift` package dependency: "product 'RxCocoa' not found"
I have created a new Swift package and trying to use the RxSwift dependency within it. I followed these instructions to add the dependency but my package is unable to build after this with the ...
1
vote
2
answers
406
views
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 ...
0
votes
0
answers
2k
views
how to import swift package in flutter project
I have swift package like this:
package
├── SigningSDK
├── Package.swift
├── README.md
├── Sources
│ ├── SigningSDK
│ └── file1.swift
└── Tests
└── ...
1
vote
0
answers
75
views
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 ...
1
vote
0
answers
31
views
I created a Swift Package and would like to include a function that returns both the name and the version of the package [duplicate]
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 ...
1
vote
0
answers
102
views
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 <UIKit/UIKit.h>
@class SwiftClassFromPackage;
@interface ...
0
votes
0
answers
54
views
Which prefix operator ! works, global or extension binding?
I made a test code for inverted bool binding as following, including almost binding ways I can think of(except @Environment...).
struct TestView: View {
@State private var isOn: Bool = false
@...
1
vote
0
answers
404
views
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 ...
6
votes
1
answer
1k
views
Cannot access Swift Package xcassets
I'm trying to use a color set from a xcassets folder that is inside a Swift Package (src). It doesn't seem to be working. I tested this out by writing a simple view that attempts to make use of the ...
3
votes
1
answer
1k
views
Xcode 14: Custom templates don't appear in Swift Package file creation
I'm in a bit of a pickle. I created custom files templates for my Xcode projects.
In a normal project environment my custom templates appear when I access the New file creation popover as you can see ...
1
vote
0
answers
256
views
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: ...
2
votes
0
answers
292
views
Error while installing Swift Package - unable to access /Package.swift
I recently added a Swift Package (IQKeyboardManager) from GitHub on to my xcworkspace Project. The Package.swift file is in the root folder of the repository. However, I got an error: /Package.swift ...
0
votes
0
answers
414
views
How to get a Swift Package to be build with the Release Build Configuration of the current Scheme in Xcode?
I have moved some of my code from my main application to a Swift Package. But I noticed a slow down.
I have set the Build Configuration to Release in the scheme configuration, but it does not seem to ...
4
votes
1
answer
1k
views
Can't name the resources folder "Resources" in my Swift package
When I use resources: [.copy("Resources")] for my Swift package, the bundle can't be built: "Command CodeSign failed with a nonzero exit code" (undle format unrecognized, invalid, ...
0
votes
0
answers
832
views
Could not find module 'RealmSwift' for target 'x86_64-apple-ios-simulator
Hello I am trying to replace all Pod dependencies in my project with Swift packages. Currently I have one blocker. There is one framework which only supports x86_64 architecture (its kotlin ...
4
votes
2
answers
3k
views
Where is package.resolved stored?
Problem
I am using Swift Package in my project
I can't find package.resolved in the following path:
[appName].xcodeproj/project.xcworkspace/xcshareddata/ (even tried showing the hidden files)
My ...
1
vote
1
answer
208
views
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(...
0
votes
1
answer
442
views
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 ...
6
votes
2
answers
819
views
Xcode won't display README when viewing a Swift Package
I converted an iOS framework project to a Swift Package.
Everything went smoothly and I can find and add the package to other projects. But Xcode won't display the README for the project. It only ...
2
votes
0
answers
233
views
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 = ...
0
votes
1
answer
232
views
Able to call generic SwiftUI View when in my project but issues once it's in a package and imported
I have a SwiftUI app that calls a View with passed in Views, methods, and variables. This view, let's call it DisplayView is general enough that I'm able to call it in different ways and have it ...
2
votes
1
answer
1k
views
Expose Swift Package as part of Another Swift Package
I have a set of Swift Packages that I'm writing (ex: CUIExpandableButton), that I'd like to roll up into another Swift Package called CrystalUI. The overall goal is to write a set of packages that get ...
5
votes
0
answers
869
views
@_exported import but in Objective-C
Swift has an interesting keyword, which can be declared in the ModuleA:
@_exported import Foundation
Then, when in some other module (e.g. ModuleB) I import the ModuleA:
import ModuleA
let ...
0
votes
1
answer
529
views
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")&...
10
votes
4
answers
9k
views
Xcode build reports "no such module" for Swift Package Manager packages. Building again and again eventually fixes it
I get "no such module" errors when trying to build after doing a "Clean Build Folder". Repeatedly trying to build eventually results in no errors.
IMPORTANT: The modules that can ...
-1
votes
1
answer
184
views
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 ...
2
votes
1
answer
3k
views
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....
5
votes
1
answer
2k
views
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: [
....
2
votes
1
answer
220
views
How can I conditionally depend on a system library for desktop vs iOS?
I'm working on a Swift package that should depend on GLFW only on desktop (MacOS or Linux), but not for iOS, since GLFW does not build for iOS.
How would I go about this?
I have a system library ...
3
votes
0
answers
2k
views
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,...
2
votes
1
answer
5k
views
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 ...
1
vote
1
answer
2k
views
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+...
4
votes
0
answers
297
views
Xcode Cloud Failing on Archive due to Swift Package
I have a Swift Package (GeoSwift) that I’m including in a project I’m trying to set up with Xcode Cloud for a build / archive / release for Test Flight workflow.
When running that build I keep getting ...
2
votes
1
answer
233
views
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 ...
0
votes
1
answer
444
views
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 ...
2
votes
0
answers
1k
views
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 '...
3
votes
1
answer
3k
views
How to use Swift Packages in Visual Studio Code?
I'm new with Swift and all this tools.
I've tried to look for guides but they didn't help me. I wanna try to work with packages in VS code.So I decided to add a SwiftyJSON package. This is my Package....
3
votes
1
answer
933
views
ITMS-90334: Invalid Code Signature Identifier when building via Xcode Cloud
I have started a small collection of helper code in a Swift Package for my own needs. If i include this package in my main project using Swift Package Manger and try to build it using Xcode Cloud, i ...
1
vote
0
answers
111
views
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 ...
9
votes
1
answer
762
views
Why Doesn't Swift Package Manager Ask For A Filename?
In a regular Xcode project app, when I create a new file, it will offer me a template (eg. SwiftUI/Swift/Storyboard) to choose from. I choose a template, click on next, and the prompt will allow me to ...
15
votes
3
answers
6k
views
How do I show code coverage in Swift Packages?
On my M1 mac, using Xcode 13.3, I created a package and displayed the code coverage bar (Editor menu –> Code Coverage).
After running tests, there is no indication of code coverage at all in the ...
3
votes
3
answers
4k
views
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 ...
7
votes
0
answers
3k
views
Swift Package Manager Public Headers with Complicated Layouts
I have a sample Swift Package Manager package (let's call it TestPackage), that is structured in the following way:
TestPackage/
Sources/
TestPackage/
Services/
Services.h
...
7
votes
0
answers
2k
views
Swift Package Manager: two similar targets different only with the dependencies
I'm migrating a library built and tested as an Xcode Project to Swift Package Manager. The project contains 3 targets: the library itself, the same library but with different dependency and the test (...
4
votes
0
answers
2k
views
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 ...
5
votes
3
answers
3k
views
Add forked Swift Package in Xcode project
I recently forked a Swift Package library from GitHub in order to implement a functionality that I've been missing. However, when I try to add my version of the package in a Xcode project (by adding ...
1
vote
0
answers
243
views
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 ...
7
votes
2
answers
6k
views
How to use other swift packages in an own swift package? [duplicate]
I'm currently developing a Swift Package in which I would like to use other Swift Packages. To do so I added the packages I want to use to the dependencies in my Package.swift
dependencies: [
// ...
8
votes
1
answer
3k
views
Swift Package Manifest - What is the difference between library targets and target dependencies?
In Package.swift, what is the difference between adding a target the array of targets within a library versus adding a target to the array of dependencies.
In this first example, 'Helpers' is added as ...