Post

Replies

Boosts

Views

Activity

Reminders app developer tutorial console warning: ... The existing content view does not support the new configuration
Hi, I am working through the https://developer.apple.com/tutorials/app-dev-training/editing-reminders The app runs as described, but in the Xcode 26.1.1 console, I get numerous warnings that say: Warning: You are setting a new content configuration to a cell that has an existing content configuration, but the existing content view does not support the new configuration. This means the existing content view must be replaced with a new content view created from the new configuration, instead of updating the existing content view directly, which is expensive. Use separate registrations or reuse identifiers for different types of cells to avoid this. Make a symbolic breakpoint at UIContentConfigurationAlertForReplacedContentView to catch this in the debugger. Does this app need to be updated for Xcode 26, or are there settings in Xcode 26 that I need to make to get rid of these warnings? Thanks
0
0
20
5d
Diffable datasource and how to add new items / use snapshots properly
First question: I'd like to get clarification on what code I have to write to add a new item to a UICollectionView. So far, I have managed to seed my datasource with some sample data, which correctly appears in the collectionView. snapshot.appendSections(sections) // assume there is only 1 section. snapshot.appendItems(["addBoat"], toSection: .Boat)// placeholder for an add button snapshot.appendItems(backingStore.BoatIdentifiers(), toSection: .Boats)// add the boats in the backing store. dataSource.apply(snapshot, animatingDifferences: false) After the user enters the necessary data for a new boat, my code creates a new item instance (a struct). The sample project DiffableDataSourceSample README states: While a diffable data source can determine the changes between its current snapshot and a new one, it doesn't monitor the data collection for changes. Instead, it's the responsibility of the app to detect data changes and tell the diffable data source about those changes, by applying a new snapshot. So does that really mean that when I add one new item, I have to 1) add it to my backing store, and then 2) create a new snapshot with all the data in my backing store so that I can 3) apply that to the dataSource? Intuitively, if my backing store has a couple thousand items, step 2 feels it could be very costly. I was expecting that I could just append the new item to the existing snapshot (the one I created when seeding the data). But that means I have to keep the snapshot alive (and pass it around viewControllers). Something like this: snapshot.appendItems(newBoat.id, toSection: .Boats) Second, related question: I need to check that a new item doesn't already exist. Do I need to check in the existing snapshot? Like this: if let index = snapshot.indexOfItem(newBoat.id) { ... // boat is duplicate, don't allow adding it. } Or do I check only in my backing store, and then do steps 1 2 and 3 above? Thanks for any help.
Topic: UI Frameworks SubTopic: UIKit
1
0
383
Jun ’24
NSBatchInsertRequest rejects all data if one object fails validation - can this behaviour be changed?
Hi, I am using a batchInsertRequest: objects: call with iOS 14 to insert a bunch of records into a Persistent Container. The Managed Object Model of my Container has a validation rule preventing a string attribute longer than 30 characters. If even a single record fails this validation rule, none of the objects, not even the valid ones, get persisted. Is there any way to adjust this behaviour so that only the objects that fail validation get rejected (while still using a batchInsertRequest)? Thanks Wolfe
1
0
519
Apr ’21