Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SwiftPM] Fix Localizations when using SPM #422

Merged
merged 1 commit into from
Jul 20, 2020
Merged

[SwiftPM] Fix Localizations when using SPM #422

merged 1 commit into from
Jul 20, 2020

Conversation

jeffreybergier
Copy link
Contributor

In Xcode 12 and Swift 5.3, Apple added the ability for Swift Packages to contain resources. This is required to support localizations and NIB's and other common bundle resources.

In this PR I modified the Package.swift to include the localizations and added some code to load the new (strange) way of loading the SwiftPM compiled bundle.

Some resources that are helpful for understanding the changes:

Note: that there is supposed to be easier support for finding the bundle in Objective-C with the #define SWIFTPM_MODULE_BUNDLE but I could not figure out how to make the .h file find this. It is compiled and put there as a build product but I couldn't figure out how to make the .h file find this. So I had to build it manually looking at the implementation provided by Apple.

Also Note: that this will break SPM support in Xcode 11 and lower. This is probably for the best as TOCropViewController compiled with in Xcode 11 with SPM will not be localized and will degrade user experience if a developer ships this and does not realize it.

@TimOliver
Copy link
Owner

Awesome. Thanks so much Jeff!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants