Skip to content

Commit dfcfbf2

Browse files
committed
Holy smokes, what didn't I add in this commit...
- Huge status page update: graphs and tabs! Ugh, I guess that doesn't sound like much, but it took a lot of work and I'm proud of how it looks so far, okay? - DFU page update: status bar, general UI tweaks, and a "stop transfer" button that lets you halt the DFU transfer if you made a whoopsie. - DFU function optimization - Added a little deal where if the side menu is open and you tap the collapsed main screen, it closes the side menu. - Increased hamburger button size to make it not so difficult to tap - More sorting/organizing/compartmentalizing/minimizing/optimizing of code
1 parent 5d26088 commit dfcfbf2

17 files changed

Lines changed: 456 additions & 186 deletions

Infini-iOS.xcodeproj/project.pbxproj

Lines changed: 52 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88

99
/* Begin PBXBuildFile section */
1010
26318B1626CB27E70036051E /* Infini_iOS.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 26318B1426CB27E70036051E /* Infini_iOS.xcdatamodeld */; };
11+
263B20B526CD673900676BF0 /* StatusViewTabs.swift in Sources */ = {isa = PBXBuildFile; fileRef = 263B20B426CD673900676BF0 /* StatusViewTabs.swift */; };
12+
263B20BA26CDF13400676BF0 /* HeartChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = 263B20B926CDF13400676BF0 /* HeartChart.swift */; };
13+
263B20BC26CDF20400676BF0 /* BatteryChart.swift in Sources */ = {isa = PBXBuildFile; fileRef = 263B20BB26CDF20400676BF0 /* BatteryChart.swift */; };
14+
263B20C526CEB46800676BF0 /* SwiftUICharts in Frameworks */ = {isa = PBXBuildFile; productRef = 263B20C426CEB46800676BF0 /* SwiftUICharts */; };
15+
263B20C726CF07BB00676BF0 /* DFUProgressBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 263B20C626CF07BB00676BF0 /* DFUProgressBar.swift */; };
1116
264BFE4226BC51CE0050A223 /* Infini_iOSApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 264BFE4126BC51CE0050A223 /* Infini_iOSApp.swift */; };
1217
264BFE4426BC51CE0050A223 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 264BFE4326BC51CE0050A223 /* ContentView.swift */; };
1318
264BFE4626BC51CF0050A223 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 264BFE4526BC51CF0050A223 /* Assets.xcassets */; };
@@ -27,6 +32,7 @@
2732
26A6315E26C498B7005AE404 /* NordicDFU in Frameworks */ = {isa = PBXBuildFile; productRef = 26A6315D26C498B7005AE404 /* NordicDFU */; };
2833
26A6316026C4BC25005AE404 /* DFUView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26A6315F26C4BC25005AE404 /* DFUView.swift */; };
2934
26A6316326C4C6D6005AE404 /* BLEConnectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26A6316226C4C6D6005AE404 /* BLEConnectView.swift */; };
35+
26C82A5326CF4EFC0085EBE9 /* Shortcuts.intentdefinition in Sources */ = {isa = PBXBuildFile; fileRef = 26C82A5226CF4EFC0085EBE9 /* Shortcuts.intentdefinition */; };
3036
26D7816526C9EB3800BBF555 /* BLEDelegates.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26D7816426C9EB3800BBF555 /* BLEDelegates.swift */; };
3137
26D7816726C9EC3100BBF555 /* BLEManagerExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26D7816626C9EC3100BBF555 /* BLEManagerExtensions.swift */; };
3238
26D7816E26CA003B00BBF555 /* SettingsFunctions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 26D7816D26CA003B00BBF555 /* SettingsFunctions.swift */; };
@@ -56,6 +62,10 @@
5662

5763
/* Begin PBXFileReference section */
5864
26318B1526CB27E70036051E /* Infini_iOS.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Infini_iOS.xcdatamodel; sourceTree = "<group>"; };
65+
263B20B426CD673900676BF0 /* StatusViewTabs.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusViewTabs.swift; sourceTree = "<group>"; };
66+
263B20B926CDF13400676BF0 /* HeartChart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeartChart.swift; sourceTree = "<group>"; };
67+
263B20BB26CDF20400676BF0 /* BatteryChart.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BatteryChart.swift; sourceTree = "<group>"; };
68+
263B20C626CF07BB00676BF0 /* DFUProgressBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DFUProgressBar.swift; sourceTree = "<group>"; };
5969
264BFE3E26BC51CE0050A223 /* Infini-iOS.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Infini-iOS.app"; sourceTree = BUILT_PRODUCTS_DIR; };
6070
264BFE4126BC51CE0050A223 /* Infini_iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Infini_iOSApp.swift; sourceTree = "<group>"; };
6171
264BFE4326BC51CE0050A223 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
@@ -80,6 +90,7 @@
8090
26A6315A26C49841005AE404 /* DFU.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DFU.swift; sourceTree = "<group>"; };
8191
26A6315F26C4BC25005AE404 /* DFUView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DFUView.swift; sourceTree = "<group>"; };
8292
26A6316226C4C6D6005AE404 /* BLEConnectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BLEConnectView.swift; sourceTree = "<group>"; };
93+
26C82A5226CF4EFC0085EBE9 /* Shortcuts.intentdefinition */ = {isa = PBXFileReference; lastKnownFileType = file.intentdefinition; path = Shortcuts.intentdefinition; sourceTree = "<group>"; };
8394
26D7816426C9EB3800BBF555 /* BLEDelegates.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BLEDelegates.swift; sourceTree = "<group>"; };
8495
26D7816626C9EC3100BBF555 /* BLEManagerExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BLEManagerExtensions.swift; sourceTree = "<group>"; };
8596
26D7816D26CA003B00BBF555 /* SettingsFunctions.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsFunctions.swift; sourceTree = "<group>"; };
@@ -95,6 +106,7 @@
95106
isa = PBXFrameworksBuildPhase;
96107
buildActionMask = 2147483647;
97108
files = (
109+
263B20C526CEB46800676BF0 /* SwiftUICharts in Frameworks */,
98110
26A6315E26C498B7005AE404 /* NordicDFU in Frameworks */,
99111
);
100112
runOnlyForDeploymentPostprocessing = 0;
@@ -116,6 +128,25 @@
116128
/* End PBXFrameworksBuildPhase section */
117129

118130
/* Begin PBXGroup section */
131+
263B20B626CD673D00676BF0 /* Status View Components */ = {
132+
isa = PBXGroup;
133+
children = (
134+
263B20B426CD673900676BF0 /* StatusViewTabs.swift */,
135+
263B20B926CDF13400676BF0 /* HeartChart.swift */,
136+
263B20BB26CDF20400676BF0 /* BatteryChart.swift */,
137+
);
138+
path = "Status View Components";
139+
sourceTree = "<group>";
140+
};
141+
263B20C826CF07BE00676BF0 /* DFU */ = {
142+
isa = PBXGroup;
143+
children = (
144+
26A6315F26C4BC25005AE404 /* DFUView.swift */,
145+
263B20C626CF07BB00676BF0 /* DFUProgressBar.swift */,
146+
);
147+
path = DFU;
148+
sourceTree = "<group>";
149+
};
119150
264BFE3526BC51CE0050A223 = {
120151
isa = PBXGroup;
121152
children = (
@@ -190,8 +221,10 @@
190221
264DB80A26C62ED600E812C3 /* SideMenu.swift */,
191222
26A6316226C4C6D6005AE404 /* BLEConnectView.swift */,
192223
26F426EE26C72D7D00D0866B /* BLEStatusView.swift */,
193-
26A6315F26C4BC25005AE404 /* DFUView.swift */,
224+
263B20C826CF07BE00676BF0 /* DFU */,
225+
26D7816F26CA004B00BBF555 /* SettingsView.swift */,
194226
264DB80C26C633CF00E812C3 /* PageSwitcher.swift */,
227+
263B20B626CD673D00676BF0 /* Status View Components */,
195228
);
196229
path = "View Components";
197230
sourceTree = "<group>";
@@ -235,7 +268,6 @@
235268
isa = PBXGroup;
236269
children = (
237270
26D7817126CAB25600BBF555 /* Notification Settings */,
238-
26D7816F26CA004B00BBF555 /* SettingsView.swift */,
239271
26D7816D26CA003B00BBF555 /* SettingsFunctions.swift */,
240272
);
241273
path = Settings;
@@ -254,6 +286,7 @@
254286
isa = PBXGroup;
255287
children = (
256288
264BFE7526BC52720050A223 /* HexStringToData.swift */,
289+
26C82A5226CF4EFC0085EBE9 /* Shortcuts.intentdefinition */,
257290
26D7817926CAD19F00BBF555 /* ColorPalette.swift */,
258291
);
259292
path = Utilities;
@@ -277,6 +310,7 @@
277310
name = "Infini-iOS";
278311
packageProductDependencies = (
279312
26A6315D26C498B7005AE404 /* NordicDFU */,
313+
263B20C426CEB46800676BF0 /* SwiftUICharts */,
280314
);
281315
productName = "Infini-iOS";
282316
productReference = 264BFE3E26BC51CE0050A223 /* Infini-iOS.app */;
@@ -351,7 +385,7 @@
351385
mainGroup = 264BFE3526BC51CE0050A223;
352386
packageReferences = (
353387
26A6315C26C498B7005AE404 /* XCRemoteSwiftPackageReference "IOS-DFU-Library" */,
354-
26F426F026C8468300D0866B /* XCRemoteSwiftPackageReference "SwiftUTI" */,
388+
263B20C326CEB46800676BF0 /* XCRemoteSwiftPackageReference "SwiftUICharts" */,
355389
);
356390
productRefGroup = 264BFE3F26BC51CE0050A223 /* Products */;
357391
projectDirPath = "";
@@ -396,6 +430,7 @@
396430
isa = PBXSourcesBuildPhase;
397431
buildActionMask = 2147483647;
398432
files = (
433+
263B20BA26CDF13400676BF0 /* HeartChart.swift in Sources */,
399434
26D7817026CA004B00BBF555 /* SettingsView.swift in Sources */,
400435
26D7816726C9EC3100BBF555 /* BLEManagerExtensions.swift in Sources */,
401436
264BFE4B26BC51CF0050A223 /* Persistence.swift in Sources */,
@@ -405,6 +440,7 @@
405440
26A6315226BF45E0005AE404 /* BLEMusic.swift in Sources */,
406441
26F426EF26C72D7D00D0866B /* BLEStatusView.swift in Sources */,
407442
264BFE7426BC526C0050A223 /* BLEManager.swift in Sources */,
443+
263B20C726CF07BB00676BF0 /* DFUProgressBar.swift in Sources */,
408444
26A6314D26BEFD2C005AE404 /* MusicController.swift in Sources */,
409445
264DB80B26C62ED600E812C3 /* SideMenu.swift in Sources */,
410446
264DB80D26C633CF00E812C3 /* PageSwitcher.swift in Sources */,
@@ -413,7 +449,10 @@
413449
264BFE7626BC52720050A223 /* HexStringToData.swift in Sources */,
414450
26D7817326CAB27800BBF555 /* WatchNotificationsView.swift in Sources */,
415451
26D7817526CAB79200BBF555 /* PhoneNotificationsView.swift in Sources */,
452+
263B20BC26CDF20400676BF0 /* BatteryChart.swift in Sources */,
453+
263B20B526CD673900676BF0 /* StatusViewTabs.swift in Sources */,
416454
26D7816E26CA003B00BBF555 /* SettingsFunctions.swift in Sources */,
455+
26C82A5326CF4EFC0085EBE9 /* Shortcuts.intentdefinition in Sources */,
417456
26A6316326C4C6D6005AE404 /* BLEConnectView.swift in Sources */,
418457
26D7816526C9EB3800BBF555 /* BLEDelegates.swift in Sources */,
419458
26A6315B26C49841005AE404 /* DFU.swift in Sources */,
@@ -741,17 +780,17 @@
741780
/* End XCConfigurationList section */
742781

743782
/* Begin XCRemoteSwiftPackageReference section */
744-
26A6315C26C498B7005AE404 /* XCRemoteSwiftPackageReference "IOS-DFU-Library" */ = {
783+
263B20C326CEB46800676BF0 /* XCRemoteSwiftPackageReference "SwiftUICharts" */ = {
745784
isa = XCRemoteSwiftPackageReference;
746-
repositoryURL = "https://github.com/NordicSemiconductor/IOS-DFU-Library.git";
785+
repositoryURL = "https://github.com/willdale/SwiftUICharts.git";
747786
requirement = {
748-
branch = master;
787+
branch = main;
749788
kind = branch;
750789
};
751790
};
752-
26F426F026C8468300D0866B /* XCRemoteSwiftPackageReference "SwiftUTI" */ = {
791+
26A6315C26C498B7005AE404 /* XCRemoteSwiftPackageReference "IOS-DFU-Library" */ = {
753792
isa = XCRemoteSwiftPackageReference;
754-
repositoryURL = "git@github.com:mkeiser/SwiftUTI.git";
793+
repositoryURL = "https://github.com/NordicSemiconductor/IOS-DFU-Library.git";
755794
requirement = {
756795
branch = master;
757796
kind = branch;
@@ -760,6 +799,11 @@
760799
/* End XCRemoteSwiftPackageReference section */
761800

762801
/* Begin XCSwiftPackageProductDependency section */
802+
263B20C426CEB46800676BF0 /* SwiftUICharts */ = {
803+
isa = XCSwiftPackageProductDependency;
804+
package = 263B20C326CEB46800676BF0 /* XCRemoteSwiftPackageReference "SwiftUICharts" */;
805+
productName = SwiftUICharts;
806+
};
763807
26A6315D26C498B7005AE404 /* NordicDFU */ = {
764808
isa = XCSwiftPackageProductDependency;
765809
package = 26A6315C26C498B7005AE404 /* XCRemoteSwiftPackageReference "IOS-DFU-Library" */;

Infini-iOS/BLE/BLEDelegates.swift

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,26 @@ extension BLEManager: CBPeripheralDelegate {
2727
if characteristic.properties.contains(.read) {
2828
peripheral.readValue(for: characteristic)
2929
}
30-
31-
if characteristic.uuid == notifyCBUUID {
32-
// I'm sure there's a less clunky way to grab the full characteristic for the sendNotification() function, but this works fine for now
33-
notifyCharacteristic = characteristic
34-
if firstConnect {
35-
sendNotification(notification: "iOS Connected!")
36-
firstConnect = false
37-
}
30+
// Need to grab some characteristics now, namely those that don't respond to didUpdateValueFor.
31+
// TODO: if AMS and ANCS are implemented, this whole switch can probably be deleted...
32+
switch characteristic.uuid {
33+
case musicControlCBUUID:
34+
peripheral.setNotifyValue(true, for: characteristic)
35+
musicChars.control = characteristic
36+
case musicTrackCBUUID:
37+
musicChars.track = characteristic
38+
case musicArtistCBUUID:
39+
// select artist characteristic for writing to music app
40+
musicChars.artist = characteristic
41+
case notifyCBUUID :
42+
// I'm sure there's a less clunky way to grab the full characteristic for the sendNotification() function, but this works fine for now
43+
notifyCharacteristic = characteristic
44+
if firstConnect {
45+
sendNotification(notification: "iOS Connected!")
46+
firstConnect = false
47+
}
48+
default:
49+
break
3850
}
3951
}
4052
}
@@ -43,10 +55,9 @@ extension BLEManager: CBPeripheralDelegate {
4355
switch characteristic.uuid {
4456
case musicControlCBUUID:
4557
// listen for the music controller notifications
46-
musicChars.control = characteristic
47-
peripheral.setNotifyValue(true, for: characteristic)
4858
let musicControl = [UInt8](characteristic.value!)
4959
controlMusic(controlNumber: Int(musicControl[0]))
60+
print(musicControl)
5061

5162
case musicTrackCBUUID:
5263
// select track characteristic for writing to music app
@@ -58,24 +69,26 @@ extension BLEManager: CBPeripheralDelegate {
5869

5970
case hrmCBUUID:
6071
// subscribe to HRM, read heart rate hex, convert to decimal
61-
heartBPM = "Reading"
6272
peripheral.setNotifyValue(true, for: characteristic)
6373
let bpm = heartRate(from: characteristic)
64-
heartBPM = String(bpm)
74+
heartBPM = Double(bpm)
75+
if bpm != 0 {
76+
hrmChartDataPoints.append(updateChartInfo(data: Double(bpm), heart: true))
77+
}
6578

6679
case batCBUUID:
6780
// subscribe to battery updates, read battery hex data, convert it to decimal
68-
batteryLevel = "Reading"
6981
peripheral.setNotifyValue(true, for: characteristic)
7082
let batData = [UInt8](characteristic.value!)
71-
batteryLevel = String(batData[0])
83+
batChartDataPoints.append(updateChartInfo(data: Double(batData[0]), heart: false))
84+
batteryLevel = Double(batData[0])
85+
7286

7387
case timeCBUUID:
7488
// convert string with hex value of time to actual hex data, then write to PineTime
7589
peripheral.writeValue(currentTime().hexData, for: characteristic, type: .withResponse)
7690

7791
case firmwareCBUUID:
78-
firmwareVersion = "Reading"
7992
firmwareVersion = String(decoding: characteristic.value!, as: UTF8.self)
8093
default:
8194
break

Infini-iOS/BLE/BLEManager.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import Foundation
99
import CoreBluetooth
10+
import SwiftUICharts
1011

1112

1213
class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate {
@@ -36,8 +37,10 @@ class BLEManager: NSObject, ObservableObject, CBCentralManagerDelegate {
3637
@Published var isSwitchedOn = false // for now this is used to display if bluetooth is on in the main app screen. maybe an alert in the future?
3738
@Published var isScanning = false // another UI flag. Probably not necessary for anything but debugging. I dunno maybe a little swirly animation or something could be triggered by this
3839
@Published var isConnectedToPinetime = false // another flag published to update UI stuff. Can probably be implemented better in the future
39-
@Published var heartBPM: String = "Disconnected" // published var to communicate the HRM data to the UI.
40-
@Published var batteryLevel: String = "Disconnected" // Same as heartBPM but for battery data
40+
@Published var heartBPM: Double = 0 // published var to communicate the HRM data to the UI.
41+
@Published var batteryLevel: Double = 0 // Same as heartBPM but for battery data
42+
@Published var hrmChartDataPoints: [LineChartDataPoint] = []
43+
@Published var batChartDataPoints: [LineChartDataPoint] = []
4144
@Published var firmwareVersion: String = "Disconnected"
4245

4346
// Selecting and connecting variables

Infini-iOS/BLE/BLEManagerExtensions.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
import Foundation
1111
import CoreBluetooth
12+
import SwiftUICharts
1213

1314
extension BLEManager {
1415

@@ -34,6 +35,12 @@ extension BLEManager {
3435
}
3536
}
3637

38+
func updateChartInfo(data: Double, heart: Bool) -> LineChartDataPoint {
39+
let dateFormat = DateFormatter()
40+
dateFormat.dateFormat = "H:mm:ss"
41+
return LineChartDataPoint(value: data, xAxisLabel: "Time", description: dateFormat.string(from: Date()), date: Date())
42+
}
43+
3744
// this function pulls date from phone, shuffles it into the correct order, and then hex-encodes it to a format that InfiniTime can understand
3845
func currentTime() -> String {
3946
let now = Date() // current time

Infini-iOS/ContentView.swift

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
//
77

88
import SwiftUI
9+
import SwiftUICharts
910
import CoreData
1011

1112
struct ContentView: View {
1213

13-
//@State var showMenu = false
1414
@EnvironmentObject var pageSwitcher: PageSwitcher
1515
@EnvironmentObject var bleManager: BLEManager
16+
1617
@AppStorage("autoconnect") var autoconnect: Bool = false
1718
@AppStorage("autoconnectUUID") var autoconnectUUID: String = ""
1819

@@ -24,9 +25,9 @@ struct ContentView: View {
2425
UINavigationBar.appearance().backgroundColor = .clear
2526
}
2627

27-
2828
var body: some View {
2929
let drag = DragGesture()
30+
// this drag gesture allows swiping right to open the side menu and left to close the side menu
3031
.onEnded {
3132
if $0.translation.width < -100 {
3233
withAnimation {
@@ -36,21 +37,39 @@ struct ContentView: View {
3637
withAnimation {
3738
self.pageSwitcher.showMenu = true
3839
}
39-
//} else if $0.translation.height < -300 {
40-
// pageSwitcher.connectViewLoad = true
4140
}
4241
}
42+
// let timer = Timer.publish(every: 60, on: .main, in: .common).autoconnect()
4343

4444
return NavigationView {
4545
GeometryReader { geometry in
4646
ZStack(alignment: .leading) {
4747
MainView()
4848
.sheet(isPresented: $pageSwitcher.connectViewLoad, content: {
49+
// pop-up menu to connect to a device
4950
Connect().environmentObject(self.bleManager)
5051
})
5152
.frame(width: geometry.size.width, height: geometry.size.height)
5253
.offset(x: self.pageSwitcher.showMenu ? geometry.size.width/2 : 0)
5354
.disabled(self.pageSwitcher.showMenu ? true : false)
55+
.overlay(Group {
56+
// this overlay lets you tap on the main screen to close the side menu. swiftUI requires a view that is not Color.clear and has any opacity level > 0
57+
if pageSwitcher.showMenu {
58+
Color.white
59+
.opacity(pageSwitcher.showMenu ? 0.01 : 0)
60+
.onTapGesture {
61+
withAnimation {
62+
pageSwitcher.showMenu = false
63+
}
64+
}
65+
}
66+
})
67+
// TODO: decide if this matters? I want the graph to show up because I spent a lot of time on it, but is it important enough to pollute it with a ton of data at the expense of the phone's processing power?
68+
// P.S. don't forget timer above the navigation view
69+
//
70+
//.onReceive(timer) { _ in
71+
// bleManager.batChartDataPoints.append(bleManager.updateChartInfo(data: bleManager.batteryLevel, heart: false))
72+
//}
5473
.onAppear(){
5574
// if autoconnect is set, start scan ASAP, but give bleManager half a second to start up
5675
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5, execute: {
@@ -80,6 +99,8 @@ struct ContentView: View {
8099
}
81100
}) {
82101
Image(systemName: "line.horizontal.3")
102+
.padding(.vertical, 10)
103+
.padding(.horizontal, 7)
83104
.imageScale(.large)
84105
.foregroundColor(Color.gray)
85106
}
@@ -101,7 +122,7 @@ struct MainView: View {
101122
var body: some View {
102123
switch pageSwitcher.currentPage {
103124
case .dfu:
104-
DFU_Page(dfuUpdater: DFU_Updater(ble: bleManager))
125+
DFU_Page()
105126
case .status:
106127
DeviceView()
107128
case .settings:

0 commit comments

Comments
 (0)