Post

Replies

Boosts

Views

Activity

Comment on modelContext.fetch() hits assert on release builds, but not on debug builds
Would that hit an assert() - which is basically unhandable crash? Or throw an exception? Also, why would assert be hit only on release builds and not debug builds with exact same code? @Model final class WorkspaceModel: MyModelProtocol { typealias DTOType = WorkspaceDTO var recordName: String final class WorkspaceDTO: MyDtoProtocol { typealias ModelType = WorkspaceModel var recordNameType: String
Feb ’25
Comment on Can someone explain why this state property is nil despite being updated before the other state property?
@darkpaw I reintroduced in my project isProcessingShare state property to reflect sharing progress and now the sheet shows up correctly the first time. Likewise, if from official Apple CKShare demo app I merely remove isProcessingShare then official Apple demo app stops working. I think Apple demo app is poorly designed that for CKShare to work there needs to be progress redrawn.
Topic: UI Frameworks SubTopic: SwiftUI
Aug ’24
Comment on Can someone explain why this state property is nil despite being updated before the other state property?
@darkpaw Still the same behavior - I see "No sheet to show": Here is what I changed: DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) { print ("Setting showingShare to true at \(Date.now.timeIntervalSince1970)") showingShare = true } entered shareConfiguration at 1724105717.827956 returning from shareConfiguration at 1724105718.080661 Setting showingShare to true at 1724105721.139563
Topic: UI Frameworks SubTopic: SwiftUI
Aug ’24
Comment on Can someone explain why this state property is nil despite being updated before the other state property?
Isn't await keyword supposed to serve as synchronization point and line after it executed only when current line is await-ed? FWIW I added following prints to dump time: entered shareConfiguration function at 1724102594.9793549 returning from shareConfiguration function at 1724102595.200552 setting showingShare to true at 1724102595.200789 <-- this is logged just before setting showingShare to true.
Topic: UI Frameworks SubTopic: SwiftUI
Aug ’24
Comment on LaunchAgent can't connect to CloudKit daemon
Thought to followup, if i put my launchdm agent's plist file in /home/user/Library/LaunchAgents then cloudkit works. But everything all else equal if I simply put it in /Library/LaunchAgents then cloudkit does not work.
Replies
Boosts
Views
Activity
May ’25
Comment on modelContext.fetch() hits assert on release builds, but not on debug builds
@DTS Engineer I’ve uploaded reproduction instructions to FB16485212, including a minimal patch that needs to be applied to Xcode’s default new project template. Is there a way to check if someone from Apple Engineering is reviewing this issue?
Replies
Boosts
Views
Activity
Feb ’25
Comment on modelContext.fetch() hits assert on release builds, but not on debug builds
FB16485212
Replies
Boosts
Views
Activity
Feb ’25
Comment on modelContext.fetch() hits assert on release builds, but not on debug builds
And: protocol MyModelProtocol: PersistentModel { associatedtype DTOType: MyDtoProtocol where DTOType.ModelType == Self var recordName: String { get set } protocol MyDtoProtocol { associatedtype ModelType: PersistentModel & MyModelProtocol where ModelType.DTOType == Self var recordNameType: String { get set }
Replies
Boosts
Views
Activity
Feb ’25
Comment on modelContext.fetch() hits assert on release builds, but not on debug builds
Would that hit an assert() - which is basically unhandable crash? Or throw an exception? Also, why would assert be hit only on release builds and not debug builds with exact same code? @Model final class WorkspaceModel: MyModelProtocol { typealias DTOType = WorkspaceDTO var recordName: String final class WorkspaceDTO: MyDtoProtocol { typealias ModelType = WorkspaceModel var recordNameType: String
Replies
Boosts
Views
Activity
Feb ’25
Comment on How to Share a CloudKit Record with Multiple Participants While Keeping Individual Records Private?
How would one go about implementing sharing model where with one User action two zones are shared and two zones are accepted?
Replies
Boosts
Views
Activity
Jan ’25
Comment on Is there a way for my macos app to run NSRunningApplication.terminate()?
To give more context: what I am trying to create is parental controls where unwanted apps are immediately killed. I was not able to get the Apple Screen Time APIs (ManagedSettings, FamilyControls etc) that work on iOS to work on MacOS. So I thought second best thing would be to simply kill unwanted apps.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’24
Comment on Importing Data into SwiftData in the Background Using ModelActor and @Query
To me it seems that automatic UI refreshes when data is changed from background is again broken. I am now on 18.1 (22b5069a) and it does not work. In the past I tried older builds and I am willing to swear that it worked back then for at least one of the Beta releases.
Replies
Boosts
Views
Activity
Oct ’24
Comment on Installation on this device is prohibited by ManagedConfiguration
This is neither work or school device. But it is wireless carrier subsidized phone. I tried to check profiles installed but could not find unless I looked into wrong place. Any tips where I could see these "configuration profiles" in the settings?
Replies
Boosts
Views
Activity
Oct ’24
Comment on Does SwiftData History API (introduced in WWD24) allows to also monitor value changes?
That's a bummer that values are not retained. However, wouldn't the SwiftData Undo feature imply that under some circumstances previous values could be retained?
Replies
Boosts
Views
Activity
Sep ’24
Comment on CKSyncEngine.RecordZoneChangeBatch and the CKSyncEngineDelegate protocol
I am facing the exact same issue as adamek. Only because RecordType is not passed together with RecordID in the nextRecordZoneChangeBatch I have to do lookups in all possible local storage tables to find local record. Unnecessary extra code and slows down my application.
Replies
Boosts
Views
Activity
Aug ’24
Comment on CKSyncEngine.RecordZoneChangeBatch and the CKSyncEngineDelegate protocol
You are completely right! The way Apple designed this part of CKSyncEngine does not seem well thought through. It should be not just CKrecordID that is passed to nextRecordZoneChangeBatch, but also RecordType.
Replies
Boosts
Views
Activity
Aug ’24
Comment on Can someone explain why this state property is nil despite being updated before the other state property?
@darkpaw I reintroduced in my project isProcessingShare state property to reflect sharing progress and now the sheet shows up correctly the first time. Likewise, if from official Apple CKShare demo app I merely remove isProcessingShare then official Apple demo app stops working. I think Apple demo app is poorly designed that for CKShare to work there needs to be progress redrawn.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’24
Comment on Can someone explain why this state property is nil despite being updated before the other state property?
@darkpaw Still the same behavior - I see "No sheet to show": Here is what I changed: DispatchQueue.main.asyncAfter(deadline: .now() + 3.0) { print ("Setting showingShare to true at \(Date.now.timeIntervalSince1970)") showingShare = true } entered shareConfiguration at 1724105717.827956 returning from shareConfiguration at 1724105718.080661 Setting showingShare to true at 1724105721.139563
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’24
Comment on Can someone explain why this state property is nil despite being updated before the other state property?
Isn't await keyword supposed to serve as synchronization point and line after it executed only when current line is await-ed? FWIW I added following prints to dump time: entered shareConfiguration function at 1724102594.9793549 returning from shareConfiguration function at 1724102595.200552 setting showingShare to true at 1724102595.200789 <-- this is logged just before setting showingShare to true.
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Aug ’24