Skip to content

Commit 5e7e763

Browse files
committed
Stop using subscript overloads
1 parent b475445 commit 5e7e763

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

config/ConfigExample/RemoteConfigViewController.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,18 @@ class RemoteConfigViewController: UIViewController {
9292

9393
/// This method applies our remote config values to our UI
9494
private func updateUI() {
95-
remoteConfigView.topLabel.text = remoteConfig[stringValue: "topLabelKey"]
95+
remoteConfigView.topLabel.text = try? remoteConfig["topLabelKey"].decoded()
9696
updateJSONView()
97-
var bottomLabel = remoteConfig[stringValue: "bottomLabelKey"]
98-
let freeCount = remoteConfig[intValue: "freeCount"]
99-
if freeCount > 1, bottomLabel.contains("one") {
97+
if var bottomLabel: String = try? remoteConfig["bottomLabelKey"].decoded(),
98+
let freeCount: Int = try? remoteConfig["freeCount"].decoded(),
99+
freeCount > 1, bottomLabel.contains("one") {
100100
let formatter = NumberFormatter()
101101
formatter.numberStyle = .spellOut
102102
if let english = formatter.string(from: NSNumber(value: freeCount)) {
103103
bottomLabel = bottomLabel.replacingOccurrences(of: "one free", with: "\(english) free")
104104
}
105+
remoteConfigView.bottomLabel.text = bottomLabel
105106
}
106-
remoteConfigView.bottomLabel.text = bottomLabel
107107
}
108108

109109
// MARK: - Private Helpers

0 commit comments

Comments
 (0)