Post

Replies

Boosts

Views

Activity

Reply to (Swift + CloudKit) or (SwiftUi + Core Data + CloudKit)
It depends in so many factors, such as how many records you will have, if you need to be able to work offline, and so on. I have an App (private) that shared a large number of records using CloudKit and a local cache with coredata. Now I'm dividing that App in multiple Apps and I thing I will use a mix between full synchronize tables and cache tables, all sharing the same record zone. I would recommend that you start using only CloudKit, then you can start adding coredata for cache, if you realize that you need it.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jun ’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 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 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 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 CloudKit RecordZone sharing limit
Just a comment, I have had much more than 5000 records in a single CKRecord shared for many many years without many problems, so I think that limit is no longer valid.
Replies
Boosts
Views
Activity
Jun ’21
Reply to (Swift + CloudKit) or (SwiftUi + Core Data + CloudKit)
It depends in so many factors, such as how many records you will have, if you need to be able to work offline, and so on. I have an App (private) that shared a large number of records using CloudKit and a local cache with coredata. Now I'm dividing that App in multiple Apps and I thing I will use a mix between full synchronize tables and cache tables, all sharing the same record zone. I would recommend that you start using only CloudKit, then you can start adding coredata for cache, if you realize that you need it.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jun ’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
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 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 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 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 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 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 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 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 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 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 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 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