@@ -38,30 +38,31 @@ class TabReflector: TabReflective {
38
38
39
39
func reflectHormones( ) {
40
40
guard let sdk = sdk else { return }
41
- guard let hormonesVC = hormonesViewController else { return }
41
+ guard let hormonesViewController = hormonesViewController else { return }
42
42
sdk. hormones. reloadContext ( )
43
43
let method = sdk. settings. deliveryMethod. value
44
44
let icon = PDIcons [ method]
45
45
let expiredCount = sdk. hormones. totalExpired
46
46
let title = PDTitleStrings . Hormones [ method]
47
47
let item = UITabBarItem ( title: title, image: icon, selectedImage: icon)
48
48
item. badgeValue = expiredCount > 0 ? " \( expiredCount) " : nil
49
- hormonesVC . title = title
50
- hormonesVC . tabBarItem = nil // Set to nil first to force redraw
51
- hormonesVC . tabBarItem = item
52
- hormonesVC . awakeFromNib ( )
49
+ hormonesViewController . title = title
50
+ hormonesViewController . tabBarItem = nil // Set to nil first to force redraw
51
+ hormonesViewController . tabBarItem = item
52
+ hormonesViewController . awakeFromNib ( )
53
53
}
54
54
55
55
func reflectPills( ) {
56
- guard let pillsVC = pillsViewController else { return }
56
+ guard let pillsViewController = pillsViewController else { return }
57
57
guard let sdk = sdk else { return }
58
- guard let item = pillsVC. tabBarItem else { return }
58
+ guard let item = pillsViewController. tabBarItem else { return }
59
+ sdk. pills. reloadContext ( )
59
60
let expiredCount = sdk. pills. totalDue
60
61
item. badgeValue = expiredCount > 0 ? " \( expiredCount) " : nil
61
62
let log = PDLog < TabReflector > ( )
62
63
log. info ( " Settings pills tab to \( item. badgeValue ?? " nil " ) " )
63
- pillsVC . tabBarItem = item
64
- pillsVC . awakeFromNib ( )
64
+ pillsViewController . tabBarItem = item
65
+ pillsViewController . awakeFromNib ( )
65
66
}
66
67
67
68
private func loadViewControllerTabTextAttributes( ) {
0 commit comments