Post

Replies

Boosts

Views

Activity

Reply to Can't start a game in Game Center (GameKit)
After analyzing almost line by line the real time game sample given by Apple, I found one little difference, I didn't have the Group Activities entitlement. After adding this, the multiplayer game started working again. Probably this was not a requirement in previous versions, I don't know, but problem solved. I supposed Apple could give a better error message, though.
Jan ’24
Reply to PhaseAnimator on presented View crashes the app
I'm having the exact same problem and it made me lose a lot of time. I tried using opacity to show/hide the view that I wanted to animate and it worked until I tried to "navigate" to another view and the UI got unresponsive. There is a loop and a possible memory leak happening. It seems I will need to use the timer trick for now.
Sep ’23
Reply to Cloudkit per user?
Private database: uses the storage of the user. Shared database: uses the storage of the owner of the data. Public database: up to certain capacity is free (depending on the number of users), more than that is charged to you, the developer. (as fas as I know).
Sep ’21
Reply to actors, SwiftUI and @Published
I have the same, a @MainActor @Published inside a actor (class) and I don't have any problem to use it from SwiftUI. Maybe the problem is where are you using it. If you are inside another actor, you should probably call it using MainActor.run {} or something like that. (sorry, I'm still learning, that's why I'm not entirely sure)
Aug ’21
Reply to How to make a pop up view?
There is a modifier called popup. You could add it to your button. @State var presentPopup = false Button { presentPopup = true } label: { Text("Rules") } .popup(isPresented: $presentPopup) { TheViewWithTheRulesAndADismissButton() } Or something like that. Just be clear that on iPhone it will appear as a sheet, that means, using all the screen.
Jul ’21
Reply to Unable to populate value from CloudKit onto my display
Hi, I can see a couple of mistakes. The first one, you should create your new Ping() inside your recordFetched block, and I would use a struct, not a class. The second is that you are printing the return from loadPing(), that will print to your console only. If you want to automatically show them, you should fetch them from an ObservableObject, similar to what it seems to be UserProgress. Basically you create a model, and your results as @Published array that you can put in a ForEach. Finally, your operations run asynchronously. Probably your return is return an empty array because the operations are still running in another thread.
Jul ’21