Skip to content

Commit b4a3a4f

Browse files
committed
transfer v2.2.5 updates from LF to LF_3
1 parent 5db433a commit b4a3a4f

68 files changed

Lines changed: 3163 additions & 1026 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Config.xcconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
unique_id = ${DEVELOPMENT_TEAM}
77

88
//Version (DEFAULT)
9-
LOOP_FOLLOW_MARKETING_VERSION = 2.2.4
9+
LOOP_FOLLOW_MARKETING_VERSION = 2.2.5

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
source "https://rubygems.org"
22

33
gem "fastlane"
4-
gem "rexml", "= 3.2.9"
4+
gem "rexml", "3.3.2"

Gemfile.lock

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ GEM
172172
trailblazer-option (>= 0.1.1, < 0.2.0)
173173
uber (< 0.2.0)
174174
retriable (3.1.2)
175-
rexml (3.2.9)
175+
rexml (3.3.2)
176176
strscan
177177
rouge (2.0.7)
178178
ruby2_keywords (0.0.5)
@@ -201,13 +201,12 @@ GEM
201201
unf_ext (0.0.9.1)
202202
unicode-display_width (2.5.0)
203203
word_wrap (1.0.0)
204-
xcodeproj (1.24.0)
204+
xcodeproj (1.19.0)
205205
CFPropertyList (>= 2.3.3, < 4.0)
206206
atomos (~> 0.1.3)
207207
claide (>= 1.0.2, < 2.0)
208208
colored2 (~> 3.1)
209209
nanaimo (~> 0.3.0)
210-
rexml (~> 3.2.4)
211210
xcpretty (0.3.0)
212211
rouge (~> 2.0.7)
213212
xcpretty-travis-formatter (1.0.1)
@@ -222,7 +221,7 @@ PLATFORMS
222221

223222
DEPENDENCIES
224223
fastlane
225-
rexml (= 3.2.9)
224+
rexml (= 3.3.2)
226225

227226
BUNDLED WITH
228227
2.4.19

LoopFollow.xcodeproj/project.pbxproj

Lines changed: 170 additions & 18 deletions
Large diffs are not rendered by default.

LoopFollow/Application/AppDelegate.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
4242

4343
UNUserNotificationCenter.current().delegate = self
4444

45+
// Ensure ViewControllerManager is initialized
46+
_ = ViewControllerManager.shared
47+
4548
return true
4649
}
4750

LoopFollow/Application/Base.lproj/Main.storyboard

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,23 +505,39 @@
505505
</objects>
506506
<point key="canvasLocation" x="-703" y="746"/>
507507
</scene>
508-
<!--Alarms-->
508+
<!--Remote-->
509509
<scene sceneID="sEH-4N-YEn">
510510
<objects>
511-
<viewController storyboardIdentifier="AlarmViewController" id="7an-Fz-r9u" customClass="AlarmViewController" customModule="Loop_Follow" customModuleProvider="target" sceneMemberID="viewController">
511+
<viewController storyboardIdentifier="RemoteViewController" id="7an-Fz-r9u" customClass="RemoteViewController" customModule="Loop_Follow" customModuleProvider="target" sceneMemberID="viewController">
512512
<view key="view" contentMode="scaleToFill" id="53u-XU-GCk">
513513
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
514514
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
515515
<viewLayoutGuide key="safeArea" id="SlM-Sc-PIr"/>
516516
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
517517
</view>
518-
<tabBarItem key="tabBarItem" title="Alarms" image="alarm" catalog="system" id="c7L-5b-Di9"/>
518+
<tabBarItem key="tabBarItem" title="Remote" image="antenna.radiowaves.left.and.right" catalog="system" id="c7L-5b-Di9"/>
519519
<navigationItem key="navigationItem" id="Lph-Pi-ZZL"/>
520520
</viewController>
521521
<placeholder placeholderIdentifier="IBFirstResponder" id="Rld-0Y-q4t" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
522522
</objects>
523523
<point key="canvasLocation" x="130" y="700"/>
524524
</scene>
525+
<!--Alarms-->
526+
<scene sceneID="a12-B3-C4d">
527+
<objects>
528+
<viewController storyboardIdentifier="AlarmViewController" id="b34-C5-D6e" customClass="AlarmViewController" customModule="Loop_Follow" customModuleProvider="target" sceneMemberID="viewController">
529+
<view key="view" contentMode="scaleToFill" id="c56-D7-E8f">
530+
<rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
531+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
532+
<viewLayoutGuide key="safeArea" id="d78-E9-F0g"/>
533+
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
534+
</view>
535+
<navigationItem key="navigationItem" id="e90-F1-G2h"/>
536+
</viewController>
537+
<placeholder placeholderIdentifier="IBFirstResponder" id="f12-G3-H4i" userLabel="First Responder" customClass="UIResponder" sceneMemberID="firstResponder"/>
538+
</objects>
539+
<point key="canvasLocation" x="130" y="700"/>
540+
</scene>
525541
<!--Settings-->
526542
<scene sceneID="ORV-wr-Fd3">
527543
<objects>

LoopFollow/Controllers/Alarms.swift

Lines changed: 101 additions & 105 deletions
Large diffs are not rendered by default.

LoopFollow/Controllers/Graphs.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ extension MainViewController {
636636
if Float(entries[i].sgv) > topBG - maxBGOffset {
637637
topBG = Float(entries[i].sgv) + maxBGOffset
638638
}
639-
let value = ChartDataEntry(x: Double(entries[i].date), y: Double(entries[i].sgv), data: formatPillText(line1: bgUnits.toDisplayUnits(String(entries[i].sgv)), time: entries[i].date))
639+
let value = ChartDataEntry(x: Double(entries[i].date), y: Double(entries[i].sgv), data: formatPillText(line1: Localizer.toDisplayUnits(String(entries[i].sgv)), time: entries[i].date))
640640
if UserDefaultsRepository.debugLog.value { writeDebugLog(value: "BG: " + value.description) }
641641
mainChart.append(value)
642642
smallChart.append(value)
@@ -731,7 +731,7 @@ extension MainViewController {
731731
colors.append(color ?? NSUIColor.systemPurple)
732732
}
733733

734-
let value = ChartDataEntry(x: predictionData[i].date, y: predictionVal, data: formatPillText(line1: bgUnits.toDisplayUnits(String(predictionData[i].sgv)), time: predictionData[i].date))
734+
let value = ChartDataEntry(x: predictionData[i].date, y: predictionVal, data: formatPillText(line1: Localizer.toDisplayUnits(String(predictionData[i].sgv)), time: predictionData[i].date))
735735
mainChart.addEntry(value)
736736
smallChart.addEntry(value)
737737
}
@@ -1025,7 +1025,7 @@ extension MainViewController {
10251025
let graphHours = 24 * UserDefaultsRepository.downloadDays.value
10261026
if bgCheckData[i].date < dateTimeUtils.getTimeIntervalNHoursAgo(N: graphHours) { continue }
10271027

1028-
let value = ChartDataEntry(x: Double(bgCheckData[i].date), y: Double(bgCheckData[i].sgv), data: formatPillText(line1: bgUnits.toDisplayUnits(String(bgCheckData[i].sgv)), time: bgCheckData[i].date))
1028+
let value = ChartDataEntry(x: Double(bgCheckData[i].date), y: Double(bgCheckData[i].sgv), data: formatPillText(line1: Localizer.toDisplayUnits(String(bgCheckData[i].sgv)), time: bgCheckData[i].date))
10291029
BGChart.data?.dataSets[dataIndex].addEntry(value)
10301030
if UserDefaultsRepository.smallGraphTreatments.value {
10311031
BGChartFull.data?.dataSets[dataIndex].addEntry(value)
@@ -1573,7 +1573,7 @@ extension MainViewController {
15731573
data: formatPillText(
15741574
line1: chartLabel,
15751575
time: predictionData[i].date,
1576-
line2: bgUnits.toDisplayUnits(String(predictionVal))
1576+
line2: Localizer.toDisplayUnits(String(predictionVal))
15771577
)
15781578
)
15791579
mainChart.addEntry(value)

LoopFollow/Controllers/NightScout.swift

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,17 @@ extension MainViewController {
1919
var created_at: String
2020
}
2121

22-
22+
struct iageData: Codable {
23+
var created_at: String
24+
}
25+
2326
//NS Basal Profile Struct
2427
struct basalProfileStruct: Codable {
2528
var value: Double
2629
var time: String
2730
var timeAsSeconds: Double
2831
}
29-
30-
struct NSProfile: Decodable {
31-
struct Store: Decodable {
32-
struct BasalEntry: Decodable {
33-
let value: Double
34-
let time: String
35-
let timeAsSeconds: Double
36-
}
37-
38-
let basal: [BasalEntry]
39-
}
40-
41-
let store: [String: Store]
42-
let defaultProfile: String
43-
}
44-
32+
4533
//NS Basal Data Struct
4634
struct basalGraphStruct: Codable {
4735
var basalRate: Double

LoopFollow/Controllers/Nightscout/BGData.swift

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ extension MainViewController {
2121
print("Error fetching Dexcom data: \(error.localizedDescription)")
2222

2323
// If we get an error, immediately try to pull NS BG Data
24-
if UserDefaultsRepository.url.value != "" {
24+
if IsNightscoutEnabled() {
2525
self.webLoadNSBGData()
2626
}
2727
return
@@ -35,14 +35,14 @@ extension MainViewController {
3535
// If Dex data is old, load from NS instead
3636
let latestDate = data[0].date
3737
let now = dateTimeUtils.getNowTimeIntervalUTC()
38-
if (latestDate + 330) < now && UserDefaultsRepository.url.value != "" {
38+
if (latestDate + 330) < now && IsNightscoutEnabled() {
3939
self.webLoadNSBGData()
4040
print("Dex data is old, loading from NS instead")
4141
return
4242
}
4343

4444
// Dexcom only returns 24 hrs of data. If we need more, call NS.
45-
if graphHours > 24 && UserDefaultsRepository.url.value != "" {
45+
if graphHours > 24 && IsNightscoutEnabled() {
4646
self.webLoadNSBGData(dexData: data)
4747
} else {
4848
self.ProcessDexBGData(data: data, sourceName: "Dexcom")
@@ -55,7 +55,7 @@ extension MainViewController {
5555
if UserDefaultsRepository.debugLog.value { self.writeDebugLog(value: "Download: BG") }
5656

5757
// This kicks it out in the instance where dexcom fails but they aren't using NS &&
58-
if UserDefaultsRepository.url.value == "" {
58+
if !IsNightscoutEnabled() {
5959
self.startBGTimer(time: 10)
6060
return
6161
}
@@ -239,8 +239,8 @@ extension MainViewController {
239239
var snoozerDelta = ""
240240

241241
// Set BGText with the latest BG value
242-
self.BGText.text = bgUnits.toDisplayUnits(String(latestBG))
243-
snoozerBG = bgUnits.toDisplayUnits(String(latestBG))
242+
self.BGText.text = Localizer.toDisplayUnits(String(latestBG))
243+
snoozerBG = Localizer.toDisplayUnits(String(latestBG))
244244
self.setBGTextColor()
245245

246246
// Direction handling
@@ -256,12 +256,12 @@ extension MainViewController {
256256

257257
// Delta handling
258258
if deltaBG < 0 {
259-
self.DeltaText.text = bgUnits.toDisplayUnits(String(deltaBG))
260-
snoozerDelta = bgUnits.toDisplayUnits(String(deltaBG))
259+
self.DeltaText.text = Localizer.toDisplayUnits(String(deltaBG))
260+
snoozerDelta = Localizer.toDisplayUnits(String(deltaBG))
261261
self.latestDeltaString = String(deltaBG)
262262
} else {
263-
self.DeltaText.text = "+" + bgUnits.toDisplayUnits(String(deltaBG))
264-
snoozerDelta = "+" + bgUnits.toDisplayUnits(String(deltaBG))
263+
self.DeltaText.text = "+" + Localizer.toDisplayUnits(String(deltaBG))
264+
snoozerDelta = "+" + Localizer.toDisplayUnits(String(deltaBG))
265265
self.latestDeltaString = "+" + String(deltaBG)
266266
}
267267

0 commit comments

Comments
 (0)