Post

Replies

Boosts

Views

Activity

Reply to Does SwiftUI List reuse its cells?
Hi, Claude31, thank you for the answer. So, the model looks like this: class Item { var name: String = "" @Relationship(deleteRule: .cascade, inverse: \Picture.item) var pictures: [Picture] = [] init(name: String = "", pictures: [Picture] = []) { self.name = name self.pictures = pictures } } @Model class Picture { @Attribute(.externalStorage) var imageData: Data? var thumbNailData: Data? var item: Item? init(imageData: Data? = nil, thumbNailData: Data? = nil, item: Item? = nil) { self.imageData = imageData self.thumbNailData = thumbNailData self.item = item } } And the View looks like this: struct ContentView: View { @Query private var items: [Item] var body: some View { NavigationStack { List { ForEach(items) { item in HStack { if !item.pictures.isEmpty, let pic = item.pictures.first?.thumbNailData, let uiImage = UIImage(data: pic) { Image(uiImage: uiImage) .resizable() .aspectRatio(contentMode: .fill) .frame(width: 80, height: 80) .clipShape(.rect(cornerRadius: 10)) } Text(item.name) } } } .navigationTitle("Items: \(items.count)") } } } As it appears, it already gets over 300 MB of memory and while it scrolls, it takes over 3 GB and never goes down. So am I doing something in a wrong way?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’24
Reply to How to install Xcode 15 beta
Ok, I figured it out. If you just deselect anything but the Built-in macOS 14 Beta option, the Xcode_15_Beta.xip file will be actually downloaded. But you'll get with it an empty Xcode_15_beta.xcdownloadmanifest, which basically is a text file listed some additional installation, in my case iOS 17 Beta simulator. So, before the first launch, you can select the OS options you want and download it again. You'll get the right downloadmanifest file and archives with selected simulators. A bit strange behavior, but it is what it is. I use Safary, btw.
Jun ’23