Strugging with NSFetchRequest and Type Erasure

I have a few Core Data entities which comply to the following protocol HasProp(osition).

public protocol HasProp {
  var prop: Prop? { get }
  var modifiedAt: Date? { get }
}

I would like to create a view that can take a NSFetchRequest of HasProp entities and I can't figure a way to make it work. I thave tried just using a NSFetchRequest and just cast the entities to HasProp to use the prop variable.

That works but it seems that casting to HasProp is horribly slow compared to using the entity's original type.

Terms of Service

Privacy Policy

Cookie Policy