Post

Replies

Boosts

Views

Activity

Reply to Programmatic UICollectionViewController
Have you searched for tutorials ? Some here: https://medium.com/@thenoobdev10/programmatic-uicollectionviewcontroller-tutorial-925f009c98a7 They explain how to create a property for layout and initialize collectionViewController with flowLayout. Update in AppDelegate
Topic: UI Frameworks SubTopic: UIKit
Jul ’24
Reply to SwiftUI @State vs @Binding vs @Bindable in ParentView and ChildView
What are the differences between @State, @Binding They both refer to state var in the View. But @State var "belongs" to the view @Binding var "belongs" to another view, that means there is another State var in the other view that share the same pointer. So when you change var in the other view, it is also changed in the first. There are many tutorials to explain, like these ones: https://www.hackingwithswift.com/quick-start/swiftui/what-is-the-binding-property-wrapper https://www.hackingwithswift.com/quick-start/swiftdata/whats-the-difference-between-bindable-and-binding
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
Reply to App Rejeitado - Descrição do bug: uma tela em branco foi exibida na inicialização
Do you observe the problem yourself ? Is it UIKit or SwiftUI ? A possible reason is that you have some code in appDelegate that takes too long (for instance because of betwork access). You should move this code out of appDelegate. Observa o problema pessoalmente? É o UIKit ou o SwiftUI? Uma possível razão é o facto de ter algum código na appDelegate que demora demasiado tempo (por exemplo, devido ao acesso ao betwork). Deveria retirar esse código da appDelegate. Podes mostrar o teu código appDelegate?
Jul ’24
Reply to [SwiftUI] When to use closures vs equals for variable assignment?
It is not a convention, it is a major difference. The difference is that computed var (first option) is evaluated each time the var is accessed. So it can change on the fly. The second option is initialised once for all. Consider the simple case: var myVar: Int { (0...10).randomElement()! } var myVar2 = (0...10).randomElement()! for _ in 0...3 { print(myVar, myVar2) } You get: 5 4 1 4 4 4 7 4
Jul ’24
Reply to Incorrect JSON Format with JSONEncoder
print(encoded) returns 110 bytes. When I test it with the following code, let account = AccountCreationData(name: "name", email: "email", phone: "phone", password: "password") if let encoded = try? JSONEncoder().encode(account) { print("encoded", encoded) print("content", String(data: encoded, encoding: .utf8)!) // To see the content of encoding } else { print("Failed to encode request") } I get encoded 69 bytes // (the string 'name: "name", email: "email", phone: "phone", password: "password"' is 66 bytes) content {"email":"email","password":"password","name":"name","phone":"phone"} Could you print the same log on your side ? And please show how you call createAccount. You may have a problem there. Also, why do you dispatch here: DispatchQueue.main.async { completion(resData) } } catch let jsonError as NSError {
Topic: App & System Services SubTopic: General Tags:
Jul ’24
Reply to App rejected as spam
Read the guidelines. Spam may be because your app falls into an overcrowded category without enough innovative features. Dating apps are just such a category. 4.3 Spam (b) Also avoid piling on to a category that is already saturated; the App Store has enough fart, burp, flashlight, fortune telling, dating, drinking games, and Kama Sutra apps, etc. already. We will reject these apps unless they provide a unique, high-quality experience. Spamming the store may lead to your removal from the Apple Developer Program. So, the only thing you can do is to add comments to reviewer explaining how your app provides this unique experience.
Jul ’24