From 7b8b9c9cb053ea7ac36fe78365b99dcde650d895 Mon Sep 17 00:00:00 2001 From: Wes Campaigne Date: Thu, 14 Mar 2024 14:21:04 -0400 Subject: [PATCH] Fix reference to privacy manifest in podspec When static framework linking is used with Cocoapods, files referenced using `resource` are just directly copied into the main app bundle, potentially clobbering each other or main app resources in the process. i.e., the PrivacyInfo.xcprivacy from ZIPFoundation can overwrite the one for the app itself. The correct way to include PrivacyInfo.xcprivacy is by using `resource_bundles` to create a nested bundle to contain the file. (If dynamic linking is used, this bundle will be nested inside the framework bundle for the pod; if static linking is used, the bundle is nested directly in the main app bundle. In either case, clobbering is avoided.) --- ZIPFoundation.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ZIPFoundation.podspec b/ZIPFoundation.podspec index 8f9be8ec..e70e52db 100644 --- a/ZIPFoundation.podspec +++ b/ZIPFoundation.podspec @@ -16,5 +16,5 @@ Pod::Spec.new do |s| s.visionos.deployment_target = '1.0' s.source_files = 'Sources/ZIPFoundation/*.swift' - s.resource = 'Sources/ZIPFoundation/Resources/PrivacyInfo.xcprivacy' + s.resource_bundles = {'ZIPFoundation_Privacy' => ['Sources/ZIPFoundation/Resources/PrivacyInfo.xcprivacy']} end