Just after I pressed send, I discovered my error. In the ImageAttachment class, I failed to put a colon here: “class ImageAttachment: Attachment”
class ImageAttachment: Attachment { @NSManaged var image: UIImage? @NSManaged var width: Float @NSManaged var height: Float @NSManaged var caption: String