Use of unresolved identifier 'NSCoreDataCoreSpotlightDelegate'

Hello guys.

Recently, I'm trying to add CoreSpotlight Integration to my app, and I wrote the following code:

public func createDataMainContext() -> NSManagedObjectContext {
    let bundles = [Bundle(for: PeopleToSave.self)]
    guard let model = NSManagedObjectModel.mergedModel(from: bundles) else {
        fatalError("Model not found")
    }
    let psc = NSPersistentStoreCoordinator(managedObjectModel: model)
    let storeDescription = NSPersistentStoreDescription(url: storeUrl!)
    storeDescription.shouldMigrateStoreAutomatically = true
    storeDescription.shouldInferMappingModelAutomatically = true
    let coreDataCoreSpotlightDelegate = NSCoreDataCoreSpotlightDelegate(forStoreWith: storeDescription, model: model)
    storeDescription.setOption(coreDataCoreSpotlightDelegate, forKey: NSCoreDataCoreSpotlightExporter)
    psc.addPersistentStore(with: storeDescription) { _,_ in }
    let context = NSManagedObjectContext(concurrencyType: .mainQueueConcurrencyType)
    context.persistentStoreCoordinator = psc
    return context
}

But then Xcode said that "Use of unresolved identifier 'NSCoreDataCoreSpotlightDelegate", and now I've got no idea what to do with it 😟

Answered by Frameworks Engineer in 678384022

I know this thread is quite old but I wanted to call your attention to the fact the NSCoreDataCoreSpotlightDelegate object has been updated with new features and functionality! In our session, "Showcase App Data in Spotlight", you'll:

  • Discover how Core Data can surface data from your app in Spotlight with as little as two lines of code.
  • Learn how to make that data discoverable in Spotlight search and to customize how it is presented to people on device.
  • See how to implement full-text search within your app, driven completely with the data indexed by Spotlight.

We've released a [sample application](Showcase App Data in Spotlight) and updated our documentation to demonstrate how these new capabilities work.

For more information be sure to watch our session Showcase App Data in Spotlight on Wednesday.

I know this thread is quite old but I wanted to call your attention to the fact the NSCoreDataCoreSpotlightDelegate object has been updated with new features and functionality! In our session, "Showcase App Data in Spotlight", you'll:

  • Discover how Core Data can surface data from your app in Spotlight with as little as two lines of code.
  • Learn how to make that data discoverable in Spotlight search and to customize how it is presented to people on device.
  • See how to implement full-text search within your app, driven completely with the data indexed by Spotlight.

We've released a [sample application](Showcase App Data in Spotlight) and updated our documentation to demonstrate how these new capabilities work.

For more information be sure to watch our session Showcase App Data in Spotlight on Wednesday.

Use of unresolved identifier 'NSCoreDataCoreSpotlightDelegate'
 
 
Q