diff --git a/RevenueCatUI/Views/IconView.swift b/RevenueCatUI/Views/IconView.swift index 4138cdb16f..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 plus + 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 {