Closed rampatra closed 4 years ago
I actually went ahead and tried the above and I successfully added this library as a dependency but I tried to build it I got the below errors:
Any ideas?
I am a complete greenhorn in swift so please pardon my naivety.
The swift forum helped me here and I am now able to compile the code successfully but the library is behaving weirdly. Not sure what's going on.
The button shows xxx
and doesn't work as it works in other apps like rectangle, etc.
Any help would be really appreciated.
Hi @rampatra Thanks for trying to wrap this code into a Swift Package. I cannot add an official SwiftPM support at the moment, but you’re moving in the right direction. Maybe xxx
is displayed because localization tables are not available. Make sure to copy .strings
into the main app’s Resources
. Hope this helps, and sorry for the slow reply!
No worries. I have currently gone with https://github.com/soffes/HotKey for now but I would be soon using this library after I've added a couple of urgent features in the app. I can update here once I am done.
@rampatra @shpakovski I think the problem here is that currently it's not possible to add any resources to SPM. But it will be possible pretty soon ;) https://forums.swift.org/t/se-0271-package-manager-resources/30730
@iSapozhnik yes, so I have gone with the below code (in MASLocalization.m file) to allow only English translation for now:
return [localizationBundle localizedStringForKey:key
value:key
table:MASLocalizationTableName];
I have been able to successfully convert this library to a Swift Package.
All credit goes to https://forums.swift.org/t/can-i-use-swift-package-manager-in-obj-c-code/35463/19
I was thinking to add a Package.swift file like below:
and then use it in my swift project. Can I do it?