Post

Replies

Boosts

Views

Activity

Reply to Applying new snapshot to diffable data source in iOS 15 trigger unnecessary cell registration call
Well, I thought I saw something, but maybe not... I do want to call something out, though: private let identifier = UUID() If you are ever reconstructing these items more than once, the diffableDatasource will see them as new items EVERY time. It could be wise to use something naturally unique to your "item" like the URL, for example. Also because your equatable looks like: static func == (lhs: AlbumItem, rhs: AlbumItem) -> Bool {     return lhs.identifier == rhs.identifier   } DiffableDatasource will not re-create a cell if cell if a property of the item changes. One way I think about it is this: -HashID identifies the existence of a cell in the collectionView." -If HashID and Equals match between snapshots, the collectionView will visually keep that cell consistent. For example, you'll see move animation if the item's index changes. -If HashID matches, but equality does not, then diffableDatasource will dequeue a new cell and call the configuration method. (In iOS 15 you can also nominate Items for a reconfigure instead of a full-on dequeuing.) In your case, for short term debugging, I would try using the URL as the "unique identifier" of your item. Long term, you may also need to incorporate a "modification date" into the equality method because a URL's contents can change and require a redraw the cell.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’21
Reply to PersistenceController and CloudKit
Not sure what the "right answer" is, but This is how I set mine up. let url = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "APPGROUPID")?.appendingPathComponent("NAME.sqlite")         let description = NSPersistentStoreDescription(url: url)         description.shouldMigrateStoreAutomatically = true         description.shouldInferMappingModelAutomatically = false // yours should probably be true if you're not manually migrating between schema versions         description.shouldAddStoreAsynchronously = true         description.isReadOnly = false         let options = NSPersistentCloudKitContainerOptions(containerIdentifier: "MY IDENTIFIER")         description.cloudKitContainerOptions = options         return description
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Aug ’21
Reply to Package.resolved file is missing from the repository
Update: It appears that the main reason I'm getting this error is because one of my dependencies is failing to clone. This dependency is located in a private repository also hosted on GitHub, and I've granted authorization to this additional repo. Could this be because Xcode-Cloud is trying to look in keychain for my normal git authentication info (username and token), but it's not available on the host?
Nov ’21
Reply to NSException in AppDelegate
Oh man, this could be almost anything. Are you using storyboards or Xib files? Are all your IBOutlets and IBActions connected? Does your app run if you remove some components, or try rendering with zero rows? Is your UITableViewCell properly registered on the table before you try to dequeue it?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Feb ’22
Reply to WorldMap doesn't contain all Anchors?
Well, I'm a dork. The thing that I expected to see in my ARWorldMap was an AnchorEntity, not an ARAnchor. AnchorEntities, while containing an ARAnchor internally, may not actually be getting persisted to the ARWorldMap? It's something that I will be investigating more tonight, but I wanted to add this additional information.
Topic: Spatial Computing SubTopic: ARKit Tags:
Feb ’22
Reply to Consistent spacing on a grid of ContainerRelativeShapes?
Discovered using a negative spacing in the VStack+HStack technique that matches the relative shape inset works well enough: HStack(spacing: -3) {                     VStack(spacing: -3) {                         ContainerRelativeShape()                             .inset(by: 3)                             .fill(.yellow)                         ContainerRelativeShape()                             .inset(by: 3)                             .fill(.yellow)                     }                     VStack(spacing: -3) {                         ContainerRelativeShape()                             .inset(by: 3)                             .fill(.yellow)                         ContainerRelativeShape()                             .inset(by: 3)                             .fill(.yellow)                     }                 }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’22