Post

Replies

Boosts

Views

Activity

Reply to Understanding the warning and how to fix it: Non-sendable cannot cross actor boundary
The issue is that CKRecord is not sendable, so the worry is that different threads could change the same CKRecord object, thus causing problems. There is a dangerous way to turn off the warnings. extension CKRecord: @unchecked Sendable { } Telling the compiler to turn off the warnings. In my app, as I have mentioned before, I have a CKMethods protocol that other View Controllers use. I have never had an issue with CKRecord not being sendable before this compiler update. I am working on a new update to my app and have turned done the above dangerous move, but I welcome a solution that fixes the issue while keeping why code basically in tact.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’23
Reply to Understanding the warning and how to fix it: Non-sendable cannot cross actor boundary
I have a similar situation. I have a CKMethods protocol which I use in a number of View Controllers. I get warnings about CKRecord not being sendable. What I've been doing to try to fix it is to move the functions into the View Controllers. But now I'm stuck with this among other warnings. let matchTemp = try await database.records(for: recIDs) Non-sendable type '[CKRecord.ID : Result<CKRecord, any Error>]' returned by call from main actor-isolated context to non-isolated instance method 'records(for:desiredKeys:)' cannot cross actor boundary Here's another one. let results = try await database.modifyRecords(saving: records, deleting: [], savePolicy: .allKeys, atomically: false) Non-sendable type '[CKRecord]' exiting main actor-isolated context in call to non-isolated instance method 'modifyRecords(saving:deleting:savePolicy:atomically:)' cannot cross actor boundary
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’23
Reply to SwiftUI 4: Set list background color
Try this. struct ContentView: View {     var body: some View {         List {             ForEach(0..<1) {_ in                 Text("Hello World")             }             .listRowBackground(Color.red)         }         .listStyle(.insetGrouped)     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’22
Reply to Request Help (If Possible) on Non-Sendable CloudKit Function
I've figured out a way to fix my remaining two issues. I'm making this as done.
Replies
Boosts
Views
Activity
Apr ’23
Reply to Understanding the warning and how to fix it: Non-sendable cannot cross actor boundary
The issue is that CKRecord is not sendable, so the worry is that different threads could change the same CKRecord object, thus causing problems. There is a dangerous way to turn off the warnings. extension CKRecord: @unchecked Sendable { } Telling the compiler to turn off the warnings. In my app, as I have mentioned before, I have a CKMethods protocol that other View Controllers use. I have never had an issue with CKRecord not being sendable before this compiler update. I am working on a new update to my app and have turned done the above dangerous move, but I welcome a solution that fixes the issue while keeping why code basically in tact.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to Understanding the warning and how to fix it: Non-sendable cannot cross actor boundary
I have a similar situation. I have a CKMethods protocol which I use in a number of View Controllers. I get warnings about CKRecord not being sendable. What I've been doing to try to fix it is to move the functions into the View Controllers. But now I'm stuck with this among other warnings. let matchTemp = try await database.records(for: recIDs) Non-sendable type '[CKRecord.ID : Result<CKRecord, any Error>]' returned by call from main actor-isolated context to non-isolated instance method 'records(for:desiredKeys:)' cannot cross actor boundary Here's another one. let results = try await database.modifyRecords(saving: records, deleting: [], savePolicy: .allKeys, atomically: false) Non-sendable type '[CKRecord]' exiting main actor-isolated context in call to non-isolated instance method 'modifyRecords(saving:deleting:savePolicy:atomically:)' cannot cross actor boundary
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’23
Reply to How do I get MeshResource.generateText() to anchor to something other than the camera using RealityKit and SwiftUI?
Try something like this. Adjust the position as needed. textEntity.setPosition(SIMD3<Float>(0.2, 0.2, 0.2), relativeTo: anchor) anchor.addChild(textEntity)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’22
Reply to SwiftUI 4: Set list background color
Try this. struct ContentView: View {     var body: some View {         List {             ForEach(0..<1) {_ in                 Text("Hello World")             }             .listRowBackground(Color.red)         }         .listStyle(.insetGrouped)     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Mistake in Wayfinder Watch Face for Apple Watch Ultra?
I submitted a bug report on this. FB11610535
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Swift List row background color not changing
.listRowBackground only works in a ForEach.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Xcode Apple Watch Ultra via iPhone: Failed with HTTP status 403: forbidden
Xcode 14.1 beta 3 with symbols for watchOS 9.0.1 fixed the issue.
Replies
Boosts
Views
Activity
Sep ’22
Reply to Xcode Apple Watch Ultra via iPhone: Failed with HTTP status 403: forbidden
I just started Xcode 14.1 beta 3 and I see that symbols for watchOS 9.0.1 are being downloaded. I think that's a good thing. I will test and report back.
Replies
Boosts
Views
Activity
Sep ’22
Reply to Xcode Apple Watch Ultra via iPhone: Failed with HTTP status 403: forbidden
Stand-alone that is.
Replies
Boosts
Views
Activity
Sep ’22
Reply to Xcode Apple Watch Ultra via iPhone: Failed with HTTP status 403: forbidden
I found a work-around, but it won't work with a stand-along Apple Watch app. Simply run the iOS app using Xcode and while the app is running, go into the Apple Watch and start the Apple Watch app. It worked for me. I made changes to the Apple Watch app and saw the changes on the watch when I did this.
Replies
Boosts
Views
Activity
Sep ’22
Reply to Xcode Apple Watch Ultra via iPhone: Failed with HTTP status 403: forbidden
I created a bug report. FB11577943
Replies
Boosts
Views
Activity
Sep ’22
Reply to Xcode Apple Watch Ultra via iPhone: Failed with HTTP status 403: forbidden
Tried removing and installing Developer Mode on Apple Watch. Still no go.
Replies
Boosts
Views
Activity
Sep ’22
Reply to How to Create Scrolling Like in the Apple Watch Workout App Using SwiftUI
I figured it out. It's a Carousel List. .listStyle(.carousel)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’22
Reply to Xcode b4 Simulator "Posterboard has quit unexpectantly"
It's still a problem with b6.
Replies
Boosts
Views
Activity
Aug ’22