Skip to content

Commit 2d7137c

Browse files
committed
Last-minute bug fixes and some clarity improvements for renaming of watches
1 parent 9918922 commit 2d7137c

6 files changed

Lines changed: 56 additions & 49 deletions

File tree

Infini-iOS.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/* Begin PBXBuildFile section */
1010
2617EF37270364CE00FE6F48 /* ChartViewSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2617EF36270364CE00FE6F48 /* ChartViewSelector.swift */; };
1111
2617EF3927036C9B00FE6F48 /* WhatsNewSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2617EF3827036C9B00FE6F48 /* WhatsNewSheet.swift */; };
12-
2617EF3D27036DC600FE6F48 /* WhatsNewBody090.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2617EF3C27036DC600FE6F48 /* WhatsNewBody090.swift */; };
12+
2617EF3D27036DC600FE6F48 /* WhatsNewBody.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2617EF3C27036DC600FE6F48 /* WhatsNewBody.swift */; };
1313
26318B1626CB27E70036051E /* Infini_iOS.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = 26318B1426CB27E70036051E /* Infini_iOS.xcdatamodeld */; };
1414
2632388426F2531C00D72B43 /* DFUWithBLE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2632388326F2531C00D72B43 /* DFUWithBLE.swift */; };
1515
2632388626F2548600D72B43 /* DFUWithoutBLE.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2632388526F2548600D72B43 /* DFUWithoutBLE.swift */; };
@@ -85,7 +85,7 @@
8585
/* Begin PBXFileReference section */
8686
2617EF36270364CE00FE6F48 /* ChartViewSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChartViewSelector.swift; sourceTree = "<group>"; };
8787
2617EF3827036C9B00FE6F48 /* WhatsNewSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhatsNewSheet.swift; sourceTree = "<group>"; };
88-
2617EF3C27036DC600FE6F48 /* WhatsNewBody090.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhatsNewBody090.swift; sourceTree = "<group>"; };
88+
2617EF3C27036DC600FE6F48 /* WhatsNewBody.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhatsNewBody.swift; sourceTree = "<group>"; };
8989
26318B1526CB27E70036051E /* Infini_iOS.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = Infini_iOS.xcdatamodel; sourceTree = "<group>"; };
9090
2632388326F2531C00D72B43 /* DFUWithBLE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DFUWithBLE.swift; sourceTree = "<group>"; };
9191
2632388526F2548600D72B43 /* DFUWithoutBLE.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DFUWithoutBLE.swift; sourceTree = "<group>"; };
@@ -177,7 +177,7 @@
177177
isa = PBXGroup;
178178
children = (
179179
2617EF3827036C9B00FE6F48 /* WhatsNewSheet.swift */,
180-
2617EF3C27036DC600FE6F48 /* WhatsNewBody090.swift */,
180+
2617EF3C27036DC600FE6F48 /* WhatsNewBody.swift */,
181181
);
182182
path = "What's New";
183183
sourceTree = "<group>";
@@ -544,7 +544,7 @@
544544
26318B1626CB27E70036051E /* Infini_iOS.xcdatamodeld in Sources */,
545545
266F53EC26FAABE7007481A6 /* TimeRangeTabs.swift in Sources */,
546546
26C5FAD826FC129400921207 /* ArbitraryNotificationView.swift in Sources */,
547-
2617EF3D27036DC600FE6F48 /* WhatsNewBody090.swift in Sources */,
547+
2617EF3D27036DC600FE6F48 /* WhatsNewBody.swift in Sources */,
548548
264BFE7626BC52720050A223 /* HexStringToData.swift in Sources */,
549549
2632388626F2548600D72B43 /* DFUWithoutBLE.swift in Sources */,
550550
26C5FADC26FE7EB000921207 /* SheetCloseButton.swift in Sources */,

Infini-iOS/View Components/SettingsView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import SwiftUI
1313
struct Settings_Page: View {
1414

1515
@ObservedObject var bleManager = BLEManager.shared
16+
@ObservedObject var deviceInfo = BLEDeviceInfo.shared
1617
@Environment(\.colorScheme) var colorScheme
1718

1819
@AppStorage("watchNotifications") var watchNotifications: Bool = true
@@ -28,6 +29,7 @@ struct Settings_Page: View {
2829
@State private var changedName: String = ""
2930
private var nameManager = DeviceNameManager()
3031
@State private var resultMessage = ""
32+
@State private var deviceName = ""
3133

3234
var body: some View {
3335
VStack {
@@ -52,6 +54,7 @@ struct Settings_Page: View {
5254
}.disabled(!autoconnect || autoconnectUUID.isEmpty)
5355
}
5456
Section(header: Text("Device Name")) {
57+
Text("Current Device Name: " + deviceInfo.deviceName)
5558
TextField("Enter New Name", text: $changedName)
5659
Button {
5760
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)

Infini-iOS/View Components/Sheets/SheetManager.swift

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,33 +28,27 @@ class SheetManager: ObservableObject {
2828
private var whatsNew: Bool = true
2929

3030
let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? ""
31-
var lastVersion = UserDefaults.standard.value(forKey: "lastVersion") as? String ?? ""
31+
var defaults = UserDefaults.standard
3232

3333
func showWhatsNew () -> Bool {
3434
if !whatsNew {
3535
return false
3636
} else {
3737
var showSheet = false
38-
39-
print("before: ", lastVersion, " <last | current> ", currentVersion)
40-
if lastVersion == "" {
41-
lastVersion = "0.0.0"
42-
}
43-
38+
let lastVersion = defaults.value(forKey: "lastVersion") as? String ?? "0.0.0"
4439
let comparison = currentVersion.compare(lastVersion, options: .numeric)
4540
if comparison == .orderedDescending {
4641
showSheet = true
4742
}
48-
lastVersion = currentVersion
43+
defaults.set(currentVersion, forKey: "lastVersion")
4944
whatsNew = false
5045

51-
print(showSheet)
5246
return showSheet
5347
}
5448
}
5549

5650
func setNextSheet() {
57-
let onboarding = UserDefaults.standard.value(forKey: "onboarding")// as? Bool ?? true
51+
let onboarding = defaults.value(forKey: "onboarding")
5852
if onboarding == nil {
5953
SheetManager.shared.sheetSelection = .onboarding
6054
SheetManager.shared.showSheet = true
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//
2+
// WhatsNewBody090.swift
3+
// Infini-iOS
4+
//
5+
// Created by Alex Emry on 9/28/21.
6+
//
7+
//
8+
9+
10+
import SwiftUI
11+
12+
struct WhatsNewBody: View {
13+
14+
var body: some View {
15+
ScrollView{
16+
Text("UI Changes")
17+
.font(.title2)
18+
.padding()
19+
Text("Tons of UI changes: New 'Home' view features some stats about your watch and the connect/disconnect button. DFU page was cleaned up a little. Color scheme changes were made to improve clarity for light mode users.")
20+
.padding()
21+
Text("Chart Persistence")
22+
.font(.title2)
23+
.padding()
24+
Text("Infini-iOS is now capable of saving chart data as it is generated, and chart data can now be filtered by time. I've set the watch to prune data older than a week for now, but am open to suggestions!")
25+
Text("Device Naming")
26+
.font(.title2)
27+
.padding()
28+
Text("Devices can now be named in Infini-iOS! While this name has no effect on the watch, setting a name for the device in Infini-iOS associates the UUID of the watch with the new name. Any time this watch would appear on screen (Home screen, Connect screen, etc), your chosen name will display instead of 'InfiniTime'. Hopefully this will be helpful for those of you that have more than one watch!")
29+
.padding()
30+
Text("Arbitrary Notifications")
31+
.font(.title2)
32+
.padding()
33+
Text("Now you can send arbitrary notifications to your PineTime from the Settings Menu. Have a short list of stuff to get at the store? Send the list as a notification and it will be on your wrist as you shop!")
34+
.padding()
35+
Text("Firmware Updates")
36+
.font(.title2)
37+
.padding()
38+
Text("- Updated DFU process: DFU downloads are now available! Now, when you tap the 'Select Firmware File' button, you're given the option to select a local file or download a firmware file. Tapping the download button uses the GitHub API to bring up a list of firmware files available on GitHub. Selecting a file from that list will download it and prepare it for flashing. After flashing, the file is deleted. Also, when a watch is connected, Infini-iOS will compare the firmware version number on the watch to this list, and notify you of any updates on the Home screen.")
39+
.padding()
40+
}
41+
}
42+
}
43+

Infini-iOS/View Components/Sheets/What's New/WhatsNewBody090.swift

Lines changed: 0 additions & 33 deletions
This file was deleted.

Infini-iOS/View Components/Sheets/What's New/WhatsNewSheet.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ struct WhatsNew: View {
1818
ScrollView{
1919
VStack {
2020
Text(String("What's New in \(appVersion!)"))
21-
.font(.title2)
21+
.font(.largeTitle)
2222
.padding(.horizontal)
2323
Text("Welcome to the new version of Infini-iOS! I hope you enjoy the features I've added to the app for this version. Please feel free to get in touch with me about any issues you experience or changes you'd like to see!")
2424
.padding()
2525

26-
WhatsNew090()
26+
WhatsNewBody()
2727
OnboardingDismissButton()
2828
}
2929
}

0 commit comments

Comments
 (0)