https://github.com/strongself/ramblerspotlight
RamblerSpotlight is easy way to setup CoreSpotlight in your app.
https://github.com/strongself/ramblerspotlight
Last synced: 4 months ago
JSON representation
RamblerSpotlight is easy way to setup CoreSpotlight in your app.
- Host: GitHub
- URL: https://github.com/strongself/ramblerspotlight
- Owner: strongself
- License: mit
- Created: 2017-05-10T12:33:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-10T13:11:00.000Z (about 9 years ago)
- Last Synced: 2025-03-25T19:16:11.012Z (about 1 year ago)
- Language: Objective-C
- Size: 328 KB
- Stars: 7
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Overview
**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.|
## Installation
```ruby
# Latest release of RamblerSpotlight
pod 'RamblerSpotlight'
```
Development target: ios 9.0 or later
## Usage
For full information clone the example project
Before using read [our article on Habrahabr.ru](https://habrahabr.ru/company/rambler-co/blog/268257/)
1. Create SpotlightEntityObject for your entity.
You need to create next classes:
```objective-c
@interface NameEntityChangeProviderFetchRequestFactory : NSObject
...
@interface NameEntityObjectIndexer : ObjectIndexerBase
...
@interface NameEntityObjectTransformer : NSObject
...
```
After that create SpotlightEntityObject:
```objective-c
SpotlightEntityObject *spotlightEntity = [SpotlightEntityObject entityObjectWithObjectTransformer:objectTransformer
requestFactory:requestFactory
objectIndexer:objectIndexer];
```
2. Create RamblerSpotlight's object
```objective-c
RamblerSpotlight *ramblerSpotlight = [[RamblerSpotlight alloc] init];
```
3. Setup RamblerSpotlight with entities, your app's context and CSSearchableIndex
```objective-c
NSArray *entitiesObjects = @[...];
NSManagedObjectContext *context ... ;
CSSearchableIndex *searchableIndex = [CSSearchableIndex defaultContext];
[ramblerSpotlight setupSpotlightWithSpotlightEntitiesObjects:entitiesObjects
appContext:context
searchableIndex:searchableIndex];
```
4. Start monitoring for changes to your objects in CoreData
```objective-c
[ramblerSpotlight startMonitoring];
```
## Author
- Konstantin Zinovyev, k.zinovyev@rambler-co.ru
- Egor Tolstoy, e.tolstoy@rambler-co.ru
- Vadim Smal, v.smal@rambler-co.ru
## Links
https://habrahabr.ru/company/rambler-co/blog/268257/
## License
RamblerSpotlight is available under the MIT license.
Copyright (c) 2016 StrongSelf community
See the LICENSE file for more info.