Post

Replies

Boosts

Views

Activity

Reply to Using structs with TextField
class FinalBluePrint: ObservableObject {  @Published var currentGrade: Double = 5;  @Published var desiredGrade : Double = 0;  @Published var finalWeight : Double = 0;  var finalNeededGrade : Double {   let desiredGrade = self.desiredGrade;   let currentGrade = self.currentGrade;   let finalWeight = self.finalWeight;   let finalNeededGrade = (desiredGrade - currentGrade * (100 - finalWeight)) / finalWeight;   return finalNeededGrade  } } struct ContentView: View {  @StateObject var final = FinalBluePrint()  var body : some View {   NavigationView {    VStack {     TextField("Current Grade", value: $final.currentGrade, format: .number).keyboardType(.decimalPad);     TextField("Desired Grade", value: $final.desiredGrade, format: .number).keyboardType(.decimalPad);     TextField("Final Weight", value: $final.finalWeight, format: .number).keyboardType(.decimalPad);     Text(final.currentGrade, format: .number);     Text(final.finalNeededGrade, format: .number);    }   }  } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’22
Reply to How to Active NavigationLink at Change Data in iOS 16
https://developer.apple.com/wwdc22/10054 doesn't explain multi NavigationLink in one cell.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Using structs with TextField
class FinalBluePrint: ObservableObject {  @Published var currentGrade: Double = 5;  @Published var desiredGrade : Double = 0;  @Published var finalWeight : Double = 0;  var finalNeededGrade : Double {   let desiredGrade = self.desiredGrade;   let currentGrade = self.currentGrade;   let finalWeight = self.finalWeight;   let finalNeededGrade = (desiredGrade - currentGrade * (100 - finalWeight)) / finalWeight;   return finalNeededGrade  } } struct ContentView: View {  @StateObject var final = FinalBluePrint()  var body : some View {   NavigationView {    VStack {     TextField("Current Grade", value: $final.currentGrade, format: .number).keyboardType(.decimalPad);     TextField("Desired Grade", value: $final.desiredGrade, format: .number).keyboardType(.decimalPad);     TextField("Final Weight", value: $final.finalWeight, format: .number).keyboardType(.decimalPad);     Text(final.currentGrade, format: .number);     Text(final.finalNeededGrade, format: .number);    }   }  } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Why isn't my "Add button" not working?
List in List does not work well. You should change code like below code List { Button("ADD") { } Section { ForEach(data) { datum in } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’22
Reply to Having problems trying out the example code in this session
I face to same issue in Playground. Normal Project can compile it.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jun ’22