Added km/hr and mi/hr. Did some formatting stuff.
This commit is contained in:
parent
af513b8c05
commit
acc9f86315
5 changed files with 76 additions and 26 deletions
|
|
@ -339,6 +339,8 @@
|
||||||
DEVELOPMENT_TEAM = UQJ7U8R2CV;
|
DEVELOPMENT_TEAM = UQJ7U8R2CV;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_FILE = Splits/Info.plist;
|
||||||
|
INFOPLIST_KEY_CFBundleDisplayName = Paces;
|
||||||
INFOPLIST_KEY_NSFaceIDUsageDescription = "We'll need authentication before we can show sensitive data";
|
INFOPLIST_KEY_NSFaceIDUsageDescription = "We'll need authentication before we can show sensitive data";
|
||||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
||||||
|
|
@ -353,7 +355,7 @@
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.0;
|
MARKETING_VERSION = 1.0.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = Brandlar.Splits;
|
PRODUCT_BUNDLE_IDENTIFIER = Brandlar.Paces;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
RUN_DOCUMENTATION_COMPILER = YES;
|
RUN_DOCUMENTATION_COMPILER = YES;
|
||||||
|
|
@ -375,6 +377,8 @@
|
||||||
DEVELOPMENT_TEAM = UQJ7U8R2CV;
|
DEVELOPMENT_TEAM = UQJ7U8R2CV;
|
||||||
ENABLE_PREVIEWS = YES;
|
ENABLE_PREVIEWS = YES;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
INFOPLIST_FILE = Splits/Info.plist;
|
||||||
|
INFOPLIST_KEY_CFBundleDisplayName = Paces;
|
||||||
INFOPLIST_KEY_NSFaceIDUsageDescription = "We'll need authentication before we can show sensitive data";
|
INFOPLIST_KEY_NSFaceIDUsageDescription = "We'll need authentication before we can show sensitive data";
|
||||||
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
|
||||||
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
|
||||||
|
|
@ -389,7 +393,7 @@
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
MARKETING_VERSION = 1.0.0;
|
MARKETING_VERSION = 1.0.0;
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = Brandlar.Splits;
|
PRODUCT_BUNDLE_IDENTIFIER = Brandlar.Paces;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
PROVISIONING_PROFILE_SPECIFIER = "";
|
PROVISIONING_PROFILE_SPECIFIER = "";
|
||||||
RUN_DOCUMENTATION_COMPILER = YES;
|
RUN_DOCUMENTATION_COMPILER = YES;
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,19 @@ import SwiftUI
|
||||||
struct June2022: View {
|
struct June2022: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
|
//2022-06-16
|
||||||
|
HStack {
|
||||||
|
VStack (alignment: .leading) {
|
||||||
|
Text("2022-06-17")
|
||||||
|
.font(.title2)
|
||||||
|
Text("Version Release Candidate 4\n")
|
||||||
|
.font(.footnote)
|
||||||
|
Text("\u{2022} Added km/hr and mi/hr\n\u{2022} Did some formatting with the stuff\n\u{2022} Added Back and Next buttons")
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
.padding(30)
|
||||||
|
|
||||||
//2022-06-16
|
//2022-06-16
|
||||||
HStack {
|
HStack {
|
||||||
VStack (alignment: .leading) {
|
VStack (alignment: .leading) {
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,15 @@ import SwiftUI
|
||||||
struct ChangeLog: View {
|
struct ChangeLog: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
List {
|
List {
|
||||||
Section(header: Text("2022")) {
|
Section(header: Text("2022")) {
|
||||||
NavigationLink("June", destination: June2022())
|
NavigationLink("June", destination: June2022())
|
||||||
NavigationLink("May", destination: May2022())
|
NavigationLink("May", destination: May2022())
|
||||||
NavigationLink("April", destination: April2022())
|
NavigationLink("April", destination: April2022())
|
||||||
NavigationLink("March", destination: March2022())
|
NavigationLink("March", destination: March2022())
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.listStyle(.insetGrouped)
|
}
|
||||||
.navigationTitle("Change Log")
|
.listStyle(.insetGrouped)
|
||||||
|
.navigationTitle("Change Log")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
struct ChangeLog_Previews: PreviewProvider {
|
struct ChangeLog_Previews: PreviewProvider {
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,17 @@ struct ContentView: View {
|
||||||
timeSeconds = ""
|
timeSeconds = ""
|
||||||
}
|
}
|
||||||
Spacer()
|
Spacer()
|
||||||
|
Button("Back") {
|
||||||
|
if focusedField == .distance {
|
||||||
|
focusedField = nil
|
||||||
|
} else if focusedField == .hours {
|
||||||
|
focusedField = .distance
|
||||||
|
} else if focusedField == .minutes {
|
||||||
|
focusedField = .hours
|
||||||
|
} else {
|
||||||
|
focusedField = .minutes
|
||||||
|
}
|
||||||
|
}
|
||||||
Button("Next") {
|
Button("Next") {
|
||||||
if focusedField == .distance {
|
if focusedField == .distance {
|
||||||
focusedField = .hours
|
focusedField = .hours
|
||||||
|
|
@ -112,6 +123,7 @@ struct ContentView: View {
|
||||||
}
|
}
|
||||||
PaceResults(timeHours: $timeHours, timeMinutes: $timeMinutes, timeSeconds: $timeSeconds, selectedSystem: $selectedSystem, distance: $distance)
|
PaceResults(timeHours: $timeHours, timeMinutes: $timeMinutes, timeSeconds: $timeSeconds, selectedSystem: $selectedSystem, distance: $distance)
|
||||||
}
|
}
|
||||||
|
.frame(maxWidth: 700)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -181,6 +193,8 @@ struct PaceResults: View {
|
||||||
return actualTime / distanceDub
|
return actualTime / distanceDub
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
let paceOpposite = (selectedSystem == "km" ? (pace * 1.609344) : (pace * 0.6213711922))
|
||||||
|
|
||||||
let paceFormatted:String = {
|
let paceFormatted:String = {
|
||||||
let paceSeconds = pace.truncatingRemainder(dividingBy: 1.0)
|
let paceSeconds = pace.truncatingRemainder(dividingBy: 1.0)
|
||||||
let paceMinutes = (pace.truncatingRemainder(dividingBy: 60.0) - paceSeconds)
|
let paceMinutes = (pace.truncatingRemainder(dividingBy: 60.0) - paceSeconds)
|
||||||
|
|
@ -191,7 +205,6 @@ struct PaceResults: View {
|
||||||
}()
|
}()
|
||||||
|
|
||||||
let paceFormattedOpposite:String = {
|
let paceFormattedOpposite:String = {
|
||||||
let paceOpposite = (selectedSystem == "km" ? (pace * 1.609344) : (pace * 0.6213711922))
|
|
||||||
let paceSecondsOpposite = paceOpposite.truncatingRemainder(dividingBy: 1.0)
|
let paceSecondsOpposite = paceOpposite.truncatingRemainder(dividingBy: 1.0)
|
||||||
let paceMinutesOpposite = (paceOpposite.truncatingRemainder(dividingBy: 60.0) - paceSecondsOpposite)
|
let paceMinutesOpposite = (paceOpposite.truncatingRemainder(dividingBy: 60.0) - paceSecondsOpposite)
|
||||||
let paceHoursOpposite = String(format: "%.0f", ((paceOpposite - paceMinutesOpposite) / 60))
|
let paceHoursOpposite = String(format: "%.0f", ((paceOpposite - paceMinutesOpposite) / 60))
|
||||||
|
|
@ -214,22 +227,42 @@ struct PaceResults: View {
|
||||||
// zeros to them, so that 5 minutes 7 seconds will show
|
// zeros to them, so that 5 minutes 7 seconds will show
|
||||||
// as 05:07 which is a format most people, and certainly
|
// as 05:07 which is a format most people, and certainly
|
||||||
// the people this app is intended for, will understand
|
// the people this app is intended for, will understand
|
||||||
|
|
||||||
HStack {
|
let pacePerHour: String = {
|
||||||
VStack (alignment: .leading) {
|
let pph = 60 / pace
|
||||||
Text("\(roundString(Double(removeLeadingZeros(distance: &distance)) ?? 0))\(selectedSystem)")
|
return (pace != 0 ? String(format: "%.2f", pph) : "0")
|
||||||
Text("\(convertedDistanceString)\(notSelectedSystem)")
|
}()
|
||||||
}
|
|
||||||
.frame(minWidth: 100)
|
let pacePerHourOpposite: String = {
|
||||||
Text("\(hoursFormatted):\(leadingZeros)")
|
let npph = 60 / paceOpposite
|
||||||
.padding()
|
return (pace != 0 ? String(format: "%.2f", npph) : "0")
|
||||||
|
}()
|
||||||
|
|
||||||
|
VStack {
|
||||||
|
HStack {
|
||||||
|
Text("\(hoursFormatted):\(leadingZeros)")
|
||||||
|
.padding()
|
||||||
|
.frame(minWidth: 100)
|
||||||
|
VStack (alignment: .leading) {
|
||||||
|
Text("\(roundString(Double(removeLeadingZeros(distance: &distance)) ?? 0))\(selectedSystem)")
|
||||||
|
Text("\(convertedDistanceString)\(notSelectedSystem)")
|
||||||
|
}
|
||||||
|
.frame(minWidth: 100)
|
||||||
|
}
|
||||||
|
HStack {
|
||||||
|
VStack(alignment: .leading) {
|
||||||
|
Text("\(paceFormatted)/\(selectedSystem)")
|
||||||
|
Text("\(paceFormattedOpposite)/\(notSelectedSystem)")
|
||||||
|
}
|
||||||
|
.frame(minWidth: 100)
|
||||||
|
VStack(alignment: .leading) {
|
||||||
|
Text("\(pacePerHour) \(selectedSystem)/hr")
|
||||||
|
Text("\(pacePerHourOpposite) \(notSelectedSystem)/hr")
|
||||||
|
}
|
||||||
.frame(minWidth: 100)
|
.frame(minWidth: 100)
|
||||||
VStack(alignment: .trailing) {
|
|
||||||
Text("\(paceFormatted)/\(selectedSystem)")
|
|
||||||
Text("\(paceFormattedOpposite)/\(notSelectedSystem)")
|
|
||||||
}
|
}
|
||||||
.frame(minWidth: 100)
|
|
||||||
}
|
}
|
||||||
|
.padding()
|
||||||
}
|
}
|
||||||
func removeLeadingZeros(distance: inout String) -> String {
|
func removeLeadingZeros(distance: inout String) -> String {
|
||||||
while distance.starts(with: "0") {
|
while distance.starts(with: "0") {
|
||||||
|
|
|
||||||
|
|
@ -62,8 +62,8 @@ struct DocsView: View {
|
||||||
}
|
}
|
||||||
Section(header: Text("App Information")) {
|
Section(header: Text("App Information")) {
|
||||||
NavigationLink("Software License", destination: LicenseView())
|
NavigationLink("Software License", destination: LicenseView())
|
||||||
Text("Version: Release Candidate 3")
|
Text("Version: Release Candidate 4")
|
||||||
Text("Release date: 2022-06-16")
|
Text("Release date: 2022-06-17")
|
||||||
Text("Start date: 2022-03-25")
|
Text("Start date: 2022-03-25")
|
||||||
Link("Built with SwiftUI \(Image(systemName: "swift"))", destination: URL(string: "https://developer.apple.com/xcode/swiftui")!)
|
Link("Built with SwiftUI \(Image(systemName: "swift"))", destination: URL(string: "https://developer.apple.com/xcode/swiftui")!)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue