Post

Replies

Boosts

Views

Activity

Comment on Xcode Version 15.0 beta 5 (15A5209g), SwiftData Problem - "The given data was not valid JSON."
In my case, I have an existing Core Data / CloudKit app that I am converting to SwiftData / CloudKit. The data structure is in the Cloud via CloudKit. The transition needs to be seamless from Core Data to SwiftData. My model has several image variables. Beta 5 saves the data fine. I can see it in the CloudKit dashboard. And my core data app can get the image data and display the images fine, even the data saved with Beta 5..
Jul ’23
Comment on SwiftData Predicate Issue Workaround
When I played with this situation on Swift Playgrounds, the starts(with: worked no matter if the ? was used after variable of if the ? was used. The problem is that this condition is being evaluated within the Predicate macro and I think there's something going in with that so that only the data.variable?.starts(with: SomeString) ?? false one works.
Aug ’23
Comment on Xcode Version 15.0 beta 5 (15A5209g), SwiftData Problem - "The given data was not valid JSON."
Yikes! Please file a feedback.
Replies
Boosts
Views
Activity
Jul ’23
Comment on Sharing data with SwiftData
The initializer above has changed with Beta 5. Go here for the new initializers.
Replies
Boosts
Views
Activity
Jul ’23
Comment on Xcode Version 15.0 beta 5 (15A5209g), SwiftData Problem - "The given data was not valid JSON."
In my case, I have an existing Core Data / CloudKit app that I am converting to SwiftData / CloudKit. The data structure is in the Cloud via CloudKit. The transition needs to be seamless from Core Data to SwiftData. My model has several image variables. Beta 5 saves the data fine. I can see it in the CloudKit dashboard. And my core data app can get the image data and display the images fine, even the data saved with Beta 5..
Replies
Boosts
Views
Activity
Jul ’23
Comment on Xcode Version 15.0 beta 5 (15A5209g), SwiftData Problem - "The given data was not valid JSON."
It is being defined as external storage (@Attribute(.externalStorage) var backImageData: Data?). See my original post. As I said, it worked fine until Beta 5.
Replies
Boosts
Views
Activity
Jul ’23
Comment on Xcode Version 15.0 beta 5 (15A5209g), SwiftData Problem - "The given data was not valid JSON."
The issue for me is that I am converting a core data model into a SwiftData model. It needs to be compatible with the existing data format. The conversion worked great before Beta 5.
Replies
Boosts
Views
Activity
Aug ’23
Comment on Xcode Version 15.0 beta 5 (15A5209g), SwiftData Problem - "The given data was not valid JSON."
Also, if I change my model to include a structure, that may persist the data, but how would I sync a structure with CloudKit? No, they have to fix this issue. I don't see a viable workaround that includes iCloud syncing.
Replies
Boosts
Views
Activity
Aug ’23
Comment on SwiftData AppGroups
Several of us have had an issue with Data meant for Images on Xcode 15 Beta 5. Beta 4 worked fine. Beta 5 is broken. I recommend filling a Feedback.
Replies
Boosts
Views
Activity
Aug ’23
Comment on SwiftData and 'Circular references'
Well, it crashed because I initialized items to nil, init(items: [ChildItem]? = nil). But init (items: [ChildItem]? = []) worked, did not crash.
Replies
Boosts
Views
Activity
Aug ’23
Comment on SwiftData Predicate Issue Workaround
data.variable?.starts(with: SomeString) != nil always evaluates to true. The one that works is data.variable?.starts(with: SomeString) ?? false
Replies
Boosts
Views
Activity
Aug ’23
Comment on SwiftData Predicate Issue Workaround
Here's my original thread which I closed too early. https://developer.apple.com/forums/thread/735397
Replies
Boosts
Views
Activity
Aug ’23
Comment on SwiftData Predicate Issue Workaround
When I played with this situation on Swift Playgrounds, the starts(with: worked no matter if the ? was used after variable of if the ? was used. The problem is that this condition is being evaluated within the Predicate macro and I think there's something going in with that so that only the data.variable?.starts(with: SomeString) ?? false one works.
Replies
Boosts
Views
Activity
Aug ’23
Comment on SwiftData Predicate Issue Workaround
When I say the above don't work, I mean they always evaluate to false.
Replies
Boosts
Views
Activity
Aug ’23
Comment on Does SwiftData support UIImage
Are you trying to save an Arrsy of data?
Replies
Boosts
Views
Activity
Aug ’23
Comment on SwiftUI tabItem Label Text Cut Off on iPad
Adding a sidebar for this is complicated as all of my main view controller views are UIKit views using UIViewControllerRepresentable. I have search icons and delegates to contend with. A future submittal may go with Sidebars, but for now, I'll stick with TabViews.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23
Comment on SwiftUI tabItem Label Text Cut Off on iPad
On second thought, it might be doable as a sidebar. Thank you very much for your help.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Sep ’23