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.
Topic: Graphics & Games SubTopic: GameKit Tags:
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.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
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)
Topic: Programming Languages SubTopic: Swift Tags:
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.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
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.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’21
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.
Topic: Graphics & Games SubTopic: GameKit Tags:
Replies
Boosts
Views
Activity
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.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Reply to Please explain how to use MapProxy and MapReader
I thought the same, but it seems that the MapProxy is only useful to convert point into coordinates (plus other conversions). I was hoping to get the current map zoom, orientation, rect, etc... when the user changes the map, but I haven't found any way, yet :(
Replies
Boosts
Views
Activity
Jul ’23
Reply to No NSEntityDescriptions in any model claim the NSManagedObject subclass 'CoreDataExampleTests.TodoMO' so +entity is confused
I haven't use XCTest yet, but probably it's the same problem, maybe you need to pass/set your MOC in another way. I don't think the problem is your PersistentStore or DataManager class.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to No NSEntityDescriptions in any model claim the NSManagedObject subclass 'CoreDataExampleTests.TodoMO' so +entity is confused
I have gotten a similar error when in SwiftUI the environment NSManagedObjectContext is unknown. For example in the Previews.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’22
Reply to Why does a participant of a share not have a record referenced by the root record?
Did you set the parent in the child record?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Apr ’22
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).
Replies
Boosts
Views
Activity
Sep ’21
Reply to iOS 15 beta 4 CloudKit Auth Error
iOS 15 Beta 5 fixed the problem that my ad-hoc app was having on the devices with beta 4. Hopefully, there will be an Xcode beta 5 today, too.
Replies
Boosts
Views
Activity
Aug ’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)
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Aug ’21
Reply to How to add placeholder text to TextEditor in SwiftUI?
What I do is adding a background with the placeholder in the position I want and observing the changes in the TextEditor text. So when it's empty, I show the background (placeholder) and when it's not, I hide it.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’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.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to When fetching the shared record zones, the share reference is not set
I answered myself, I can always get the CKShare requesting the CKRecord with recordName = "cloudkit.zoneshare" for the record zone I want.
Replies
Boosts
Views
Activity
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.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Crazy Ideay? Using two appleID for the same person
If you have different devices for your work and personal life, I don't see the problem, I have like three or four iCloud accounts.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Manually define a CKRecord ID for a given NSManagedObject instance
Are you doing the synchronization manually? You can add your own CKRecordID when you first create the CKRecord previously to save it to CK. Once the record lives in CK, you can't edit the ID (as far as I know). Just remember that the ID must be unique between all the CKRecord in your CKRecordZone.
Replies
Boosts
Views
Activity
Jul ’21