Post

Replies

Boosts

Views

Activity

Reply to Can someone help me fix this code.
You already posted the same question a few days ago and told it was solved. What is the new issue ? For the first error, let fetchedUser = try snapshot.data(as:User.self) I searched Firestore doc https://firebase.google.com/docs/firestore/solutions/swift-codable-data-mapping They show some sample code private func fetchBook(documentId: String) { let docRef = db.collection("books").document(documentId) docRef.getDocument(as: Book.self) { result in Book is Codable struct Book: Codable { @DocumentID var id: String? var title: String var numberOfPages: Int var author: String } Have you declared User as Codable ? See also this post: https://stackoverflow.com/questions/72103380/how-do-i-read-a-users-firestore-map-to-a-swift-dictionary For the second error, I think it was answered in reply to your previous post. remove coder parameter or call User with only coder parameter
21h
Reply to Most idiotic problem with assign value to value?
It would be so much easier if you provided simple and complete reproducible code… So I recreated a simple test code: enum ResultType { case success(formula: Float) case failure } struct CustomFunction { var formula: Float = 0.5 func checkFormula(_ formula: Float) -> ResultType { if formula > 0 { return .success(formula: formula) } return .failure } } struct CustomFormulaView: View { @Binding var function: CustomFunction @State var testFormula: Float = 0 var body: some View { HStack { Text(" test formula ") TextField("", value: $testFormula, format: .number) } .onChange(of: testFormula) { debugPrint("change of test formula: \(testFormula)") switch function.checkFormula(testFormula) { case .success(let formula): debugPrint("before Change: \(function.formula)") function.formula = formula // Nothing happens debugPrint("Test formula changed: \(testFormula)") debugPrint("set to success: \(formula)") debugPrint("what inside function? \(function.formula)") /* Task { //Generate Image testImage = await function.image( size: testImageSize), simulate: manager.finalSize) break debugPrint("test image updated for: \(function.formula)") } */ case .failure : print("failed") ; break } } } } struct ContentView: View { @State var function = CustomFunction() var body: some View { CustomFormulaView(function: $function) Text("\(function.formula)") } } And get what I understand is the expected result "change of test formula: 2.0" "before Change: 0.5" "Test formula changed: 2.0" "set to success: 2.0" "what inside function? 2.0"
1d
Reply to App branding in navigation bar on every screen.
It does not seem compliant with App review guideline 5.6, Code of conduct: Customer trust is a cornerstone of the App ecosystem. Apps should never prey on users or attempt to rip off customers, trick them into making unwanted purchases, force them to share unnecessary data, …, or engage in any other manipulative practices within or outside of the app. Your Developer Program account will be terminated if you engage in activities or actions that are not in accordance with the Developer Code of Conduct. So, it is up to you to decide to take this risk on your account.
1d