File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -92,18 +92,18 @@ class RemoteConfigViewController: UIViewController {
92
92
93
93
/// This method applies our remote config values to our UI
94
94
private func updateUI( ) {
95
- remoteConfigView. topLabel. text = remoteConfig [ stringValue : " topLabelKey " ]
95
+ remoteConfigView. topLabel. text = try ? remoteConfig [ " topLabelKey " ] . decoded ( )
96
96
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 " ) {
100
100
let formatter = NumberFormatter ( )
101
101
formatter. numberStyle = . spellOut
102
102
if let english = formatter. string ( from: NSNumber ( value: freeCount) ) {
103
103
bottomLabel = bottomLabel. replacingOccurrences ( of: " one free " , with: " \( english) free " )
104
104
}
105
+ remoteConfigView. bottomLabel. text = bottomLabel
105
106
}
106
- remoteConfigView. bottomLabel. text = bottomLabel
107
107
}
108
108
109
109
// MARK: - Private Helpers
You can’t perform that action at this time.
0 commit comments