RamblerSpotlight is easy way to setup CoreSpotlight in your app.
Key Features | |
---|---|
🚀 | Provides all the infrastructure for using objects in Spotlight. |
♻ | Keeps Spotlight data up to date. |
💾 | Saves data that needs index later. |
📲 | Battle-tested into several Rambler&Co projects. |
# Latest release of RamblerSpotlight
pod 'RamblerSpotlight'
Development target: ios 9.0 or later
For full information clone the example project
Before using read our article on Habrahabr.ru
- Create SpotlightEntityObject for your entity.
You need to create next classes:
@interface NameEntityChangeProviderFetchRequestFactory : NSObject <ChangeProviderFetchRequestFactory>
...
@interface NameEntityObjectIndexer : ObjectIndexerBase
...
@interface NameEntityObjectTransformer : NSObject <ObjectTransformer>
...
After that create SpotlightEntityObject:
SpotlightEntityObject *spotlightEntity = [SpotlightEntityObject entityObjectWithObjectTransformer:objectTransformer
requestFactory:requestFactory
objectIndexer:objectIndexer];
- Create RamblerSpotlight's object
RamblerSpotlight *ramblerSpotlight = [[RamblerSpotlight alloc] init];
- Setup RamblerSpotlight with entities, your app's context and CSSearchableIndex
NSArray<SpotlightEntityObject *> *entitiesObjects = @[...];
NSManagedObjectContext *context ... ;
CSSearchableIndex *searchableIndex = [CSSearchableIndex defaultContext];
[ramblerSpotlight setupSpotlightWithSpotlightEntitiesObjects:entitiesObjects
appContext:context
searchableIndex:searchableIndex];
- Start monitoring for changes to your objects in CoreData
[ramblerSpotlight startMonitoring];
-
Konstantin Zinovyev, [email protected]
-
Egor Tolstoy, [email protected]
-
Vadim Smal, [email protected]
https://habrahabr.ru/company/rambler-co/blog/268257/
RamblerSpotlight is available under the MIT license. Copyright (c) 2016 StrongSelf community
See the LICENSE file for more info.