I'm just looking for help/guidance on what if something I did wrong in my build submission? The first test flight build I submitted went through in about 1 day, 2 build updates after that went through and were deployed for my test flight participants each in less than 24 hours. The last build I have submitted has been 6 days now. I have had to submitted multiple builds and cancel a few of them as I keep making progress on my app. I have submitted a ticket for assistance, and called the help number. Thank you in advance for any help. I appreciate the community.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I know the below is incorrect, and I feel dumb that i can't solve this, but I'm new and I'm struggling to understand where to put the 'logic' (an if statement or other) for handling calculations in an app, based on the entered value and the state of a segmented picker. I have tried adding it as part of the picker, and it throws an error if I try and make totalTime a computed property like the below.
Cleary there is a basic level concept I am missing completely and have been unable to solve despite my searching. In general I'm looking for guidance on how to bring values in, do calculations on them, save them for use in other views etc. I tried to create a function to do this but that fell short as well. I am getting confused. I have found lots of good videos that teach many concepts, but can't seem to find a solution to this or similar situations of bringing data in, processing it in someway, storing it and then using it later / somewhere else in the app.
Thank you in advance for all the help.
SwitfUI
struct ContentView: View {
@AppStorage("totalTime") var totalTime: Double {
if timeSelected == "hours" {
totalTime = (Double(enteredValue) ?? 0) * multipier
} else {
totalTime = (Double(enteredValue) ?? 0)
}
}
@State var enteredValue = ""
@State var timeSelected = "hours"
let multipier = 2.0
let arrayLabel = ["hours", "minutes"]
var body: some View {
VStack {
Form {
Section(header: Text("Time Test")){
TextField("enter value", text: $enteredValue)
Picker("timeValue",selection: $timeSelected) {
ForEach(arrayLabel, id: \.self){
Text("\($0)")
}
}
.pickerStyle(.segmented)
}
}
}
}
}