Skip to content

Commit

Permalink
improvements from PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
aboedo committed Jul 14, 2023
1 parent e0e1b2f commit 0b1b5ce
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions RevenueCatUI/Helpers/Variables.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ protocol VariableDataProvider {

}

struct VariableMatch {
let variable: String
let range: Range<String.Index>
}

/// Processes strings, replacing `{{variable}}` with their associated content.
@available(iOS 16.0, macOS 13.0, tvOS 16.0, *)
enum VariableHandler {
Expand All @@ -34,7 +29,7 @@ enum VariableHandler {
in string: String,
with provider: VariableDataProvider
) -> String {
let matches = extractVariables(from: string)
let matches = Self.extractVariables(from: string)
var replacedString = string

for variableMatch in matches.reversed() {
Expand Down Expand Up @@ -62,6 +57,13 @@ enum VariableHandler {
}
}

private struct VariableMatch {

let variable: String
let range: Range<String.Index>

}

}

@available(iOS 16.0, macOS 13.0, tvOS 16.0, *)
Expand Down

0 comments on commit 0b1b5ce

Please sign in to comment.