|
|
@@ -266,7 +266,7 @@ class MainViewController: UIViewController, UITableViewDataSource, ChartViewDele
|
|
|
Storage.shared.colorBGText.$value
|
|
|
.receive(on: DispatchQueue.main)
|
|
|
.sink { [weak self] _ in
|
|
|
- self?.setBGTextColor()
|
|
|
+ self?.updateBGTextAppearance()
|
|
|
}
|
|
|
.store(in: &cancellables)
|
|
|
|
|
|
@@ -1200,7 +1200,7 @@ class MainViewController: UIViewController, UITableViewDataSource, ChartViewDele
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- func setBGTextColor() {
|
|
|
+ func updateBGTextAppearance() {
|
|
|
if bgData.count > 0 {
|
|
|
let latestBG = bgData[bgData.count - 1].sgv
|
|
|
var color = NSUIColor.label
|
|
|
@@ -1220,6 +1220,12 @@ class MainViewController: UIViewController, UITableViewDataSource, ChartViewDele
|
|
|
}
|
|
|
|
|
|
BGText.textColor = color
|
|
|
+
|
|
|
+ if latestBG <= globalVariables.minDisplayGlucose || latestBG >= globalVariables.maxDisplayGlucose {
|
|
|
+ BGText.font = UIFont.systemFont(ofSize: 65, weight: .black)
|
|
|
+ } else {
|
|
|
+ BGText.font = UIFont.systemFont(ofSize: 85, weight: .black)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|