Post

Replies

Boosts

Views

Activity

Reply to SwiftUI Previews creating views out of thin air?
Since the call stack was collapsed in the screenshot, here's the expanded version. It looks like the SwiftUI Preview system up to something? #0 0x00000001035e247c in closure #2 in AuthFirstCensusView.body.getter at /Users/vz/Documents/GitHub/reckoner-app/reckoner/Authentication/AuthFirstCensusView.swift:103 #1 0x00000001035e277c in partial apply for closure #2 in AuthFirstCensusView.body.getter () #2 0x00000001d1817138 in (1) await resume partial function for partial apply forwarder for closure #1 () async -> () in closure #1 (inout Swift.TaskGroup<()>) async -> () in closure #1 () async -> () in SwiftUI.AppDelegate.application(_: __C.UIApplication, handleEventsForBackgroundURLSession: Swift.String, completionHandler: () -> ()) -> () () #3 0x00000001d17b1e48 in (1) await resume partial function for dispatch thunk of static SwiftUI.PreviewModifier.makeSharedContext() async throws -> τ_0_0.Context () #4 0x00000001d19c10c0 in (1) await resume partial function for generic specialization <()> of reabstraction thunk helper <τ_0_0 where τ_0_0: Swift.Sendable> from @escaping @isolated(any) @callee_guaranteed @async () -> (@out τ_0_0) to @escaping @callee_guaranteed @async () -> (@out τ_0_0, @error @owned Swift.Error) () #5 0x00000001d17b1e48 in (1) await resume partial function for dispatch thunk of static SwiftUI.PreviewModifier.makeSharedContext() async throws -> τ_0_0.Context ()
Oct ’24
Reply to Notify when @FetchRequest changes?
I'm sure I'm going to hose the Combine terminology... but onReceive takes anything that conforms to Publisher. Trigger an auto-complete after the publisher to see what I mean. In your case, collect() seems like what you want? Collects all received elements, and emits a single array of the collection when the upstream publisher finishes. I'm looking to be notified when any change occurs, but not of the individual items. collect() is perfect for me. Someone with actual Combine knowledge can likely offer something better :)
Jan ’23