Skip to content

Commit

Permalink
fixed issue where the plus sign icon wouldn't work correctly after th…
Browse files Browse the repository at this point in the history
…e name change
  • Loading branch information
aboedo committed Aug 15, 2024
1 parent e5e8856 commit 54951e6
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions RevenueCatUI/Views/IconView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct IconView<S: ShapeStyle>: View {
let tint: S

var body: some View {
Image(self.icon.rawValue, bundle: .module)
Image(self.icon.localAssetName, bundle: .module)
.renderingMode(.template)
.resizable()
.scaledToFit()
Expand All @@ -35,7 +35,7 @@ struct IconView<S: ShapeStyle>: 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"
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 54951e6

Please sign in to comment.