Post

Replies

Boosts

Views

Activity

Reply to Hot to merge Predicate in SwiftData
@Indubitably Thank you for your answer. I followed your instructions and it's working great - however - mine is acting like an AND predicate and not an OR. If anyone is looking for OR: Replace PredicateExpressions.Conjunction with PredicateExpressions.Disjunction in the function buildConjunction (and preferably rename it) to combine the predicates using logical OR instead.
Apr ’24
Reply to The current model reference and the next model reference cannot be equal.
Thanks Guys. The type alias stuff was getting me. I manually put the static declaration with the class in front to avoid my confusion. Here's my latest VersionedSchema for clarity. enum ModelSchemaV5: VersionedSchema { static var versionIdentifier = Schema.Version(5, 0, 0) static var models: [any PersistentModel.Type] { [ // V1 ModelSchemaV1.SDAccountingClass.self, ModelSchemaV1.SDCacheRecord.self, ModelSchemaV1.SDCustomer.self, ModelSchemaV1.SDItem.self, ModelSchemaV1.SDLocation.self, ModelSchemaV1.SDTag.self, ModelSchemaV1.SDUOM.self, // V2 ModelSchemaV2.SDPurchaseOrder.self, ModelSchemaV2.SDPurchaseOrderItem.self, ModelSchemaV2.SDVendor.self, ModelSchemaV2.SDCarrier.self, ModelSchemaV2.SDInventoryLocationSummary.self, ModelSchemaV2.SDPurchaseOrderSettings.self, // V3 ModelSchemaV3.SDShip.self, ModelSchemaV3.SDSalesOrder.self, // V4 ModelSchemaV4.SDReceipt.self, ModelSchemaV4.SDDocument.self, // V5 ModelSchemaV5.SDReceiptItem.self ] } }
4w