diff --git a/RevenueCat.xcodeproj/project.pbxproj b/RevenueCat.xcodeproj/project.pbxproj index 9e301801e5..1c87f3fd1b 100644 --- a/RevenueCat.xcodeproj/project.pbxproj +++ b/RevenueCat.xcodeproj/project.pbxproj @@ -1972,7 +1972,6 @@ A563F585271E072B00246E0C /* MockBeginRefundRequestHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockBeginRefundRequestHelper.swift; sourceTree = ""; }; A563F587271E076800246E0C /* BeginRefundRequestHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeginRefundRequestHelperTests.swift; sourceTree = ""; }; A56C2E002819C33500995421 /* BackendPostAdServicesTokenTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackendPostAdServicesTokenTests.swift; sourceTree = ""; }; - A56DFDEB2866438B00EF2E32 /* AfficheClientProxy.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AfficheClientProxy.swift; sourceTree = ""; }; A56DFDEF286643BF00EF2E32 /* PostAttributionDataOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostAttributionDataOperation.swift; sourceTree = ""; }; A56DFDF1286665E600EF2E32 /* BackendPostAttributionDataTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackendPostAttributionDataTests.swift; sourceTree = ""; }; A56F9AB026990E9200AFC48F /* CustomerInfo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomerInfo.swift; sourceTree = ""; }; @@ -4350,7 +4349,6 @@ B3A55B7C26C452A7007EFC56 /* AttributionPoster.swift */, F5BE44422698581100254A30 /* AttributionTypeFactory.swift */, F5BE447A269E4A7500254A30 /* TrackingManagerProxy.swift */, - A56DFDEB2866438B00EF2E32 /* AfficheClientProxy.swift */, ); path = Attribution; sourceTree = ""; @@ -6374,6 +6372,7 @@ 2DAC5F7926F13C9800C5258F /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_ENABLE_OBJC_WEAK = YES; @@ -6391,6 +6390,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.StoreKitUnitTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos watchsimulator watchos appletvsimulator appletvos"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_EMIT_LOC_STRINGS = NO; @@ -6404,6 +6404,7 @@ 2DAC5F7A26F13C9800C5258F /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++17"; CLANG_ENABLE_OBJC_WEAK = YES; @@ -6420,6 +6421,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.StoreKitUnitTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos watchsimulator watchos appletvsimulator appletvos"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; @@ -6457,7 +6459,7 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; RUN_DOCUMENTATION_COMPILER = YES; SDKROOT = ""; - SKIP_INSTALL = YES; + SKIP_INSTALL = NO; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; @@ -6497,7 +6499,7 @@ PROVISIONING_PROFILE_SPECIFIER = ""; RUN_DOCUMENTATION_COMPILER = YES; SDKROOT = ""; - SKIP_INSTALL = YES; + SKIP_INSTALL = NO; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; @@ -6512,6 +6514,7 @@ buildSettings = { ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; @@ -6528,6 +6531,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.PurchasesTests; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; + SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; @@ -6543,6 +6547,7 @@ buildSettings = { ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; @@ -6558,6 +6563,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.PurchasesTests; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; + SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; @@ -6570,6 +6576,7 @@ 2DE20B71264087FB004C597D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CODE_SIGN_STYLE = Automatic; @@ -6585,6 +6592,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.BackendIntegrationTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; @@ -6598,6 +6606,7 @@ 2DE20B72264087FB004C597D /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CODE_SIGN_STYLE = Automatic; @@ -6612,6 +6621,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.BackendIntegrationTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; @@ -6626,6 +6636,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CODE_SIGN_STYLE = Automatic; @@ -6642,6 +6653,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.StoreKitTestApp; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx"; SUPPORTS_MACCATALYST = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; @@ -6656,6 +6668,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CODE_SIGN_STYLE = Automatic; @@ -6671,6 +6684,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.StoreKitTestApp; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx"; SUPPORTS_MACCATALYST = YES; SWIFT_VERSION = 5.0; @@ -6684,6 +6698,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; @@ -6699,6 +6714,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.StoreKitUnitTestsHostApp; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos watchsimulator watchos appletvsimulator appletvos"; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_VERSION = 5.0; @@ -6713,6 +6729,7 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; @@ -6727,6 +6744,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.StoreKitUnitTestsHostApp; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; + SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos watchsimulator watchos appletvsimulator appletvos"; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2,3,4,6"; @@ -6739,6 +6757,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -6791,6 +6810,7 @@ MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + SKIP_INSTALL = NO; SUPPORTS_MACCATALYST = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_STRICT_CONCURRENCY = targeted; @@ -6808,6 +6828,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; @@ -6854,6 +6875,7 @@ MTL_ENABLE_DEBUG_INFO = NO; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; + SKIP_INSTALL = NO; SUPPORTS_MACCATALYST = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_OPTIMIZATION_LEVEL = "-O"; @@ -6872,6 +6894,7 @@ 4F6BEE2F2A27B02400CD9322 /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CODE_SIGN_STYLE = Automatic; @@ -6887,6 +6910,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.BackendCustomEntitlementsIntegrationTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION"; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; @@ -6900,6 +6924,7 @@ 4F6BEE302A27B02400CD9322 /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CODE_SIGN_STYLE = Automatic; @@ -6914,6 +6939,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.BackendCustomEntitlementsIntegrationTests; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; @@ -6929,6 +6955,7 @@ buildSettings = { ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; @@ -6945,6 +6972,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.ReceiptParserTests; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; + SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; @@ -6959,6 +6987,7 @@ buildSettings = { ALLOW_TARGET_PLATFORM_SPECIALIZATION = YES; ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_WEAK = YES; CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; @@ -6974,6 +7003,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.ReceiptParserTests; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = ""; + SKIP_INSTALL = YES; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; @@ -7011,7 +7041,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.ReceiptParser; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; SDKROOT = ""; - SKIP_INSTALL = YES; + SKIP_INSTALL = NO; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; @@ -7051,7 +7081,7 @@ PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = ""; - SKIP_INSTALL = YES; + SKIP_INSTALL = NO; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator"; SUPPORTS_MACCATALYST = YES; SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = YES; @@ -7064,7 +7094,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_STYLE = Automatic; @@ -7098,7 +7128,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.RevenueCatUIDev; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; + SKIP_INSTALL = NO; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator"; SUPPORTS_MACCATALYST = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; @@ -7115,7 +7145,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; - BUILD_LIBRARY_FOR_DISTRIBUTION = NO; + BUILD_LIBRARY_FOR_DISTRIBUTION = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_STYLE = Automatic; @@ -7148,7 +7178,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.RevenueCatUIDev; PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; - SKIP_INSTALL = YES; + SKIP_INSTALL = NO; SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator"; SUPPORTS_MACCATALYST = YES; SWIFT_EMIT_LOC_STRINGS = YES; @@ -7164,6 +7194,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_STYLE = Automatic; @@ -7179,6 +7210,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.RevenueCatUITestsDev; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; @@ -7191,6 +7223,7 @@ isa = XCBuildConfiguration; buildSettings = { ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + BUILD_LIBRARY_FOR_DISTRIBUTION = NO; CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; CLANG_ENABLE_OBJC_WEAK = YES; CODE_SIGN_STYLE = Automatic; @@ -7205,6 +7238,7 @@ MTL_FAST_MATH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.revenuecat.RevenueCatUITestsDev; PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; SWIFT_EMIT_LOC_STRINGS = NO; SWIFT_TREAT_WARNINGS_AS_ERRORS = NO; SWIFT_VERSION = 5.0; diff --git a/RevenueCatUI/Modifiers/ViewExtensions.swift b/RevenueCatUI/Modifiers/ViewExtensions.swift index 649d35194e..6539a5102e 100644 --- a/RevenueCatUI/Modifiers/ViewExtensions.swift +++ b/RevenueCatUI/Modifiers/ViewExtensions.swift @@ -40,10 +40,13 @@ extension View { perform action: @escaping (_ newValue: V) -> Void ) -> some View where V: Equatable { #if swift(>=5.9) + // wrapping with AnyView to type erase is needed because when archiving an xcframework, + // the compiler gets confused between the types returned + // by the different implementations of self.onChange(of:value). if #available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *) { - self.onChange(of: value) { _, newValue in action(newValue) } + AnyView(self.onChange(of: value) { _, newValue in action(newValue) }) } else { - self.onChange(of: value) { newValue in action(newValue) } + AnyView(self.onChange(of: value) { newValue in action(newValue) }) } #else self.onChange(of: value) { newValue in action(newValue) } diff --git a/RevenueCatUI/Resources/icons.xcassets/add.imageset/Contents.json b/RevenueCatUI/Resources/icons.xcassets/plus.imageset/Contents.json similarity index 100% rename from RevenueCatUI/Resources/icons.xcassets/add.imageset/Contents.json rename to RevenueCatUI/Resources/icons.xcassets/plus.imageset/Contents.json diff --git a/RevenueCatUI/Resources/icons.xcassets/add.imageset/add.svg b/RevenueCatUI/Resources/icons.xcassets/plus.imageset/add.svg similarity index 100% rename from RevenueCatUI/Resources/icons.xcassets/add.imageset/add.svg rename to RevenueCatUI/Resources/icons.xcassets/plus.imageset/add.svg diff --git a/RevenueCatUI/Views/IconView.swift b/RevenueCatUI/Views/IconView.swift index 3c59376258..e7535043b3 100644 --- a/RevenueCatUI/Views/IconView.swift +++ b/RevenueCatUI/Views/IconView.swift @@ -22,7 +22,7 @@ struct IconView: View { let tint: S var body: some View { - Image(self.icon.rawValue, bundle: .module) + Image(self.icon.localAssetName, bundle: .module) .renderingMode(.template) .resizable() .scaledToFit() @@ -35,7 +35,7 @@ struct IconView: View { /// An icon to be displayed by `IconView`. enum PaywallIcon: String, CaseIterable { - case add + case plus = "add" case android case apple case attachMoney = "attach_money" @@ -82,6 +82,17 @@ enum PaywallIcon: String, CaseIterable { case key case warning + // in some cases, the local asset name can't match the backend's names + // because it causes issues with UIKit's names when generating intermediate files. + // this allows us to decouple the local asset name from the backend's name for the icon. + var localAssetName: String { + switch self { + case .plus: + return "plus" + default: + return self.rawValue + } + } } extension PaywallData.LocalizedConfiguration.Feature { diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 6e2a6b766e..d2da60eec0 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -94,7 +94,7 @@ platform :ios do repo_name: repo_name, github_api_token: ENV["GITHUB_TOKEN"], changelog_latest_path: changelog_latest_path, - upload_assets: ['RevenueCat.xcframework.zip'] + upload_assets: ['RevenueCat.xcframework.zip', 'RevenueCatUI.xcframework.zip'] ) end @@ -246,7 +246,7 @@ platform :ios do version_number = current_version_number check_no_git_tag_exists(version_number) check_pods - export_xcframework + export_xcframeworks check_no_github_release_exists(version_number) end @@ -350,7 +350,7 @@ platform :ios do desc "Create XCFramework, and create GitHub release" lane :release do |options| version_number = current_version_number - export_xcframework + export_xcframeworks github_release(version: version_number) end @@ -536,22 +536,39 @@ platform :ios do } end - desc "Export XCFramework" - lane :export_xcframework do |options| - output_directory = 'build/xcframeworks' - platforms = [ - 'iOS', - 'macOS', - 'maccatalyst', - 'tvOS', - 'watchOS', - 'visionOS' - ] + lane :export_xcframeworks do |options| + create_and_sign_xcframework( + scheme: 'RevenueCat', + product_name: 'RevenueCat', + platforms: [ + 'iOS', + 'macOS', + 'maccatalyst', + 'tvOS', + 'watchOS', + 'visionOS' + ]) + create_and_sign_xcframework( + scheme: 'RevenueCatUIDev', + product_name: 'RevenueCatUI', + platforms: [ + 'iOS', + 'maccatalyst', + 'watchOS', + ]) + end + + private_lane :create_and_sign_xcframework do |options| + scheme = options[:scheme] + product_name = options[:product_name] + platforms = options[:platforms] + + output_directory = "build/xcframeworks/#{product_name}" create_xcframework( destinations: platforms, - scheme: 'RevenueCat', - product_name: 'RevenueCat', + scheme: scheme, + product_name: product_name, xcframework_output_directory: output_directory, # Bitcode is no longer required since Xcode 14. enable_bitcode: false, @@ -566,10 +583,10 @@ platform :ios do # Sign XCFramework for Xcode 15 sign_xcframework( - file: "#{output_directory_for_sh}/RevenueCat.xcframework" + file: "#{output_directory_for_sh}/#{product_name}.xcframework" ) - xcframeworks_zip_path_for_sh = "../RevenueCat.xcframework.zip" + xcframeworks_zip_path_for_sh = "../#{product_name}.xcframework.zip" sh("ditto", "-c", "-k", "--sequesterRsrc", "--keepParent", output_directory_for_sh, xcframeworks_zip_path_for_sh) diff --git a/fastlane/README.md b/fastlane/README.md index 50340768f5..6f077312e8 100644 --- a/fastlane/README.md +++ b/fastlane/README.md @@ -250,13 +250,13 @@ Creates a new PR on purchases-ios-snapshots after new snapshot files were genera Creates RevenueCat-Swift.h for a new release -### ios export_xcframework +### ios export_xcframeworks ```sh -[bundle exec] fastlane ios export_xcframework +[bundle exec] fastlane ios export_xcframeworks ``` -Export XCFramework + ### ios backend_integration_tests