Closed bobmosh closed 1 year ago
For context I am using this in an App that will also have an iOS App, so it might be connected to that, could that be?
Solved it myself!
For anyone wondering, the library only builds for macOS targets.
In order to use it in a cross platform environment, you will need to use conditional exclusion like #if os(macOS)
on any imports / usage of code from that library (use safer methods if possible though, this is just what I used in my tests).
You will also need multiple targets (I separated my App targets into iOS/iPadOS and macOS) and remove the linked library from the Frameworks, Libraries, and Embedded Content
section of the mobile targets.
@bobmosh
I also encountered this problem. I added #if os(macOS)
to all the places where this library is used, but it still gives an error:
Is there any way to resolve this case without involving multiple targets?
By adding the conditional statement #if os(macOS) ... #endif
to all the code of KeyboardShortcuts, I have resolved this issue by ensuring that the source code only compiles on macOS, without the need to build multiple targets.
You will also need multiple targets (I separated my App targets into iOS/iPadOS and macOS) and remove the linked library from the Frameworks, Libraries, and Embedded Content section of the mobile targets.
You don't need to do that. You can make it only used for a specific platform:
You will also need multiple targets (I separated my App targets into iOS/iPadOS and macOS) and remove the linked library from the Frameworks, Libraries, and Embedded Content section of the mobile targets.
You don't need to do that. You can make it only used for a specific platform:
I have already set it to only used for macOS, but it still throws the error, so I used conditional statements to wrap all the files to fix the issue
Hey folks,
I just added the package to my personal Xcode project via SPM and the first thing that happens when I build is
No such module 'Carbon.HIToolbox'
in theCarbonKeyboardShortcuts.swift
.I tried the latest version tags as well as pulling from main, butt the issue doesn't seem to be resolvable. Anyone else have the same issue?
Cheers, Ferdi