total time now works as expected and tried (but failed) to add conversion between miles and kilometers for pace
This commit is contained in:
parent
8cb3960507
commit
addcb49778
3 changed files with 90 additions and 39 deletions
|
|
@ -11,51 +11,81 @@ struct April2022: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollView {
|
ScrollView {
|
||||||
|
|
||||||
//2022-04-10
|
//2022-04-11
|
||||||
VStack (alignment: .leading) {
|
HStack {
|
||||||
Text("2022-04-10")
|
VStack (alignment: .leading) {
|
||||||
.font(.title2)
|
Text("2022-04-11")
|
||||||
Text("Version Prerelease Build LVSXT10l\n")
|
.font(.title2)
|
||||||
.font(.footnote)
|
Text("Version Prerelease Build LVSXT10k\n")
|
||||||
Text("\u{2022} Added known issues view.\n\t\u{2022} Might add this to the change log navigation at the bottom in the future")
|
.font(.footnote)
|
||||||
|
Text("\u{2022} Fixed total time display so now 300 seconds properly wraps to 5 minutes and minutes now also wrap when seconds equates to an amount that equals more than 60 minutes\n\u{2022} Forced all text in change log to left side of screen")
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
}
|
}
|
||||||
|
.padding(30)
|
||||||
|
|
||||||
|
//2022-04-10
|
||||||
|
HStack {
|
||||||
|
VStack (alignment: .leading) {
|
||||||
|
Text("2022-04-10")
|
||||||
|
.font(.title2)
|
||||||
|
Text("Version Prerelease Build LVSXT10m\n")
|
||||||
|
.font(.footnote)
|
||||||
|
Text("\u{2022} Added known issues view\n\t\u{2022} Might add this to the change log navigation at the bottom in the future\n\u{2022} Reverted to a different commit in Git so that the app can be used")
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
|
}
|
||||||
|
.padding(30)
|
||||||
|
|
||||||
//2022-04-09
|
//2022-04-09
|
||||||
VStack (alignment: .leading) {
|
HStack {
|
||||||
Text("2022-04-09:")
|
VStack (alignment: .leading) {
|
||||||
.font(.title2)
|
Text("2022-04-09:")
|
||||||
Text("Version Prerelease Build LVSXT10n\n")
|
.font(.title2)
|
||||||
.font(.footnote)
|
Text("Version Prerelease Build LVSXT10n\n")
|
||||||
Text("\u{2022} Fixed the math with seconds so now you can actually use them! YEAH BABY!\n\u{2022} Rounded pace so that you don't get values like 4.999999999999996 minutes per km\n\t\u{2022} Working on getting the seconds to change into minutes like 340 seconds will show as 5 minutes 40 seconds or \"0:05:40\"\n\u{2022} Removed warning about not using seconds (because they work now!)\n\u{2022} Got math color right. Issue was I had my colors switched so it showed black text in dark mode, and white text in light mode.\n\u{2022} Fixed distance between time boxes\n\u{2022} Removed text about not using seconds greater than 59 in text field\n\u{2022} Properly implemented tab view so that each view gets ONE (1) tab\n\u{2022} Added Git which I should've done long ago\n\u{2022} Tweaked various visual elements. For some reason, SF Symbols doesn't have a calculator??? So instead I'm using \"candybarphone\" but \"building\" looked good, too\n\u{2022} Got overflow of minutes working so now 100 minutes will show as 1 hour 40 minutes.\n\t\u{2022} Seconds overflow does not work (see known issues)")
|
.font(.footnote)
|
||||||
|
Text("\u{2022} Fixed the math with seconds so now you can actually use them! YEAH BABY!\n\u{2022} Rounded pace so that you don't get values like 4.999999999999996 minutes per km\n\t\u{2022} Working on getting the seconds to change into minutes like 340 seconds will show as 5 minutes 40 seconds or \"0:05:40\"\n\u{2022} Removed warning about not using seconds (because they work now!)\n\u{2022} Got math color right. Issue was I had my colors switched so it showed black text in dark mode, and white text in light mode.\n\u{2022} Fixed distance between time boxes\n\u{2022} Removed text about not using seconds greater than 59 in text field\n\u{2022} Properly implemented tab view so that each view gets ONE (1) tab\n\u{2022} Added Git which I should've done long ago\n\u{2022} Tweaked various visual elements. For some reason, SF Symbols doesn't have a calculator??? So instead I'm using \"candybarphone\" but \"building\" looked good, too\n\u{2022} Got overflow of minutes working so now 100 minutes will show as 1 hour 40 minutes.\n\t\u{2022} Seconds overflow does not work (see known issues)")
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
}
|
}
|
||||||
.padding(30)
|
.padding(30)
|
||||||
|
|
||||||
//2022-04-08
|
//2022-04-08
|
||||||
VStack (alignment: .leading) {
|
HStack {
|
||||||
Text("2022-04-08:")
|
VStack (alignment: .leading) {
|
||||||
.font(.title2)
|
Text("2022-04-08:")
|
||||||
Text("Version Prerelease Build LVSXT10r\n")
|
.font(.title2)
|
||||||
.font(.footnote)
|
Text("Version Prerelease Build LVSXT10r\n")
|
||||||
Text("\u{2022} Added bullet points to change log\n\u{2022} Changed text in \"Help\" section about using seconds (ended up not working)\n\u{2022} Tried unsuccessfully to dynamically change the color of the pace formula whether in dark or light mode\n\u{2022} Temporarily removed change log in Build t\n\u{2022} Fixed positioning of minutes and seconds text boxes\n\u{2022} Total time now shows correct minute/hour time (minutes and hours are no longer equal)\n\t\u{2022} Seconds still don't work properly")
|
.font(.footnote)
|
||||||
|
Text("\u{2022} Added bullet points to change log\n\u{2022} Changed text in \"Help\" section about using seconds (ended up not working)\n\u{2022} Tried unsuccessfully to dynamically change the color of the pace formula whether in dark or light mode\n\u{2022} Temporarily removed change log in Build t\n\u{2022} Fixed positioning of minutes and seconds text boxes\n\u{2022} Total time now shows correct minute/hour time (minutes and hours are no longer equal)\n\t\u{2022} Seconds still don't work properly")
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
}
|
}
|
||||||
.padding(30)
|
.padding(30)
|
||||||
|
|
||||||
//2022-04-05
|
//2022-04-05
|
||||||
VStack (alignment: .leading) {
|
HStack {
|
||||||
Text("2022-04-05:")
|
VStack (alignment: .leading) {
|
||||||
.font(.title2)
|
Text("2022-04-05:")
|
||||||
Text("Version Prerelease Build LVSXT10u.2\n")
|
.font(.title2)
|
||||||
.font(.footnote)
|
Text("Version Prerelease Build LVSXT10u.2\n")
|
||||||
Text("\u{2022} Reformatted change log to include better navigation and clearer notice of changes")
|
.font(.footnote)
|
||||||
|
Text("\u{2022} Reformatted change log to include better navigation and clearer notice of changes")
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
}
|
}
|
||||||
.padding(30)
|
.padding(30)
|
||||||
|
|
||||||
//2022-04-03
|
//2022-04-03
|
||||||
VStack (alignment: .leading) {
|
HStack {
|
||||||
Text("2022-04-03:")
|
VStack (alignment: .leading) {
|
||||||
.font(.title2)
|
Text("2022-04-03:")
|
||||||
Text("Version Prerelease Build LVSXT10u\n")
|
.font(.title2)
|
||||||
.font(.footnote)
|
Text("Version Prerelease Build LVSXT10u\n")
|
||||||
Text("\u{2022} Fixed math\n\u{2022} Implemented change log view\n\u{2022} Restructured code so it gave fewer errors\n\u{2022} Added correct pace data\n\t\u{2022} At this time, the seconds functionality is entirely broken\n\u{2022} Implemented total time view\n\t\u{2022} For some reason, the view for the minutes automatically fills in for the hours as well")
|
.font(.footnote)
|
||||||
|
Text("\u{2022} Fixed math\n\u{2022} Implemented change log view\n\u{2022} Restructured code so it gave fewer errors\n\u{2022} Added correct pace data\n\t\u{2022} At this time, the seconds functionality is entirely broken\n\u{2022} Implemented total time view\n\t\u{2022} For some reason, the view for the minutes automatically fills in for the hours as well")
|
||||||
|
}
|
||||||
|
Spacer()
|
||||||
}
|
}
|
||||||
.padding(30)
|
.padding(30)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,26 +67,46 @@ struct PaceResults: View {
|
||||||
@Binding var distance: String
|
@Binding var distance: String
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
let timeMinutesDouble = Double(timeMinutes) ?? 0.0
|
|
||||||
let timeHours = String(Int(timeMinutesDouble / 60))
|
//var pacePerUnit = 0.0
|
||||||
|
//var notSelectedSystem = ""
|
||||||
|
|
||||||
let convertedSeconds = (Double(timeSeconds) ?? 0) * (1+(2/3))
|
let convertedSeconds = (Double(timeSeconds) ?? 0) * (1+(2/3))
|
||||||
let timeSecondsInt = Int(timeSeconds) ?? 0
|
let timeSecondsInt = Int(timeSeconds) ?? 0
|
||||||
let timeSecondsUnderSixty = (timeSecondsInt > 60 ? Int(timeSecondsInt / 60) : timeSecondsInt)
|
let timeSecondsUnderSixty = (timeSecondsInt % 60)
|
||||||
|
|
||||||
let timeMinutesInt = (Int(timeMinutes) ?? 0) + (Int(timeSecondsUnderSixty))
|
let timeSecondsToMinutes = (timeSecondsInt - timeSecondsUnderSixty) / 60
|
||||||
let timeMinutesUnderSixty = timeMinutesInt - ((Int(timeHours) ?? 0) * 60)
|
|
||||||
|
|
||||||
let leadingZeros = String(format: "%02d:%02d", timeMinutesUnderSixty, timeSecondsInt)
|
let timeMinutesDouble = Double(timeMinutes) ?? 0.0
|
||||||
|
|
||||||
|
let timeMinutesInt = (Int(timeMinutes) ?? 0) + (timeSecondsToMinutes)
|
||||||
|
let timeMinutesUnderSixty = timeMinutesInt % 60
|
||||||
|
let timeMinutesToHours = (timeMinutesInt - timeMinutesUnderSixty) / 60
|
||||||
|
|
||||||
|
let leadingZeros = String(format: "%02d:%02d", timeMinutesUnderSixty, timeSecondsUnderSixty)
|
||||||
|
|
||||||
let actualTime = timeMinutesDouble + (convertedSeconds / 100)
|
let actualTime = timeMinutesDouble + (convertedSeconds / 100)
|
||||||
let pace = actualTime / (Double(distance) ?? 1)
|
let pace = actualTime / (Double(distance) ?? 1)
|
||||||
let paceString = String(format: "%.2f", pace)
|
let paceString = String(format: "%.2f", pace)
|
||||||
|
|
||||||
|
/*
|
||||||
|
if selectedSystem == "km" {
|
||||||
|
pacePerUnit = actualTime / (distance * 1.609344)
|
||||||
|
notSelectedSystem = "mi"
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
pacePerUnit = actualTime / (distance * 0.6213711922)
|
||||||
|
notSelectedSystem = "km"
|
||||||
|
}
|
||||||
|
|
||||||
|
let pacePerUnitString = String(format: "%.02f", pacePerUnit)
|
||||||
|
*/
|
||||||
|
|
||||||
VStack {
|
VStack {
|
||||||
Text("Distance: \(distance)\(selectedSystem)")
|
Text("Distance: \(distance)\(selectedSystem)")
|
||||||
Text("Total time: \(timeHours):\(leadingZeros)")
|
Text("Total time: \(timeMinutesToHours):\(leadingZeros)")
|
||||||
Text("\(paceString) minutes per \(selectedSystem)")
|
Text("\(paceString) minutes per \(selectedSystem)")
|
||||||
|
//Text("\(pacePerUnitString) minutes per \(notSelectedSystem)")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,8 @@ struct problemView: View {
|
||||||
.font(.largeTitle)
|
.font(.largeTitle)
|
||||||
.bold()
|
.bold()
|
||||||
.padding(.top, 40)
|
.padding(.top, 40)
|
||||||
Text("\n\u{2022} You can not dismiss the keyboard\n\t\u{2022} This hides the tab bar at the bottom\n\u{2022} Visually displayed seconds and total time are incorrect\n\t\u{2022} This DOES NOT affect pace. That is still correct.")
|
Text("\n\u{2022} You can not dismiss the keyboard\n\t\u{2022} This hides the tab bar at the bottom so you can't navigate the app\n\u{2022} Entering a number that is too large (20 digits) into the minutes field will cause the app to crash")
|
||||||
|
.padding()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue