Post

Replies

Boosts

Views

Activity

Reply to How to store multiple images in swiftData?
I've noticed when I have an array of data like my imageArray below, if I explore the data stored locally by the simulator, the array doesn't seem to be stored in extern storage. I come to this conclusion because if I look at the Application Support directory & try to find the ".default_SUPPORT" hidden folder, it's not there. If I were to simply create a model of single images, each of the single images is saved in a ".default_SUPPORT" that I can see. So I'm not sure if setting up .externalStorage with an array of images is doing anything. I'd be curious if anyone has thoughts. Here is the struct I'm using that's working with my app, but that doesn't seem to actually be saving the array of images in .externalStorage, or so I've concluded due to the lack of the hidden ".default_SUPPORT" directory.: import Foundation import SwiftData @Model class Place { var city: String var country: String? @Attribute(.externalStorage) var imageArray: [Data?] init(city: String, country: String? = nil, imageArray: [Data?] = []) { self.city = city self.country = country self.imageArray = imageArray } }
Feb ’24
Reply to xcode 15 beta
When I try to drag the /Profiles/Runtimes/iOS 17.0 simruntime, I get the following error: When I've tried running simple code (you can see in the image) accessing a TextField, when I tap in the text fields, the errors shown in the Debug Pane appear. This code works fine on the release version of Xcode. Any ideas what I should do? I've tried throwing Xcode beta into the trash, restarting the computer & reinstalling, both using the Xcodes.app & Apple's site (I used Apple's beta downloads page first). No luck. I'm using an M1 MacBook Pro & Ventura 13.4.
Jun ’23
Reply to SwiftUI preview failed to launch app in reasonable time in Xcode 12.4
I had the same problem, even after restarting the entire system. I quit Xcode, deleted Derived Data, and then things worked. For those who have never deleted derived data, here's a primer: This is a url: - deriveddata.dance Curiously, when I tried the suggestion above: xcrun simctl --set previews delete all. Output states: xcrun: error: unable to find utility "simctl", not a developer tool or in PATH I know I had previously had command-line tools on this machine. Is there something I'm missing or need to reinstall? Thanks!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’21