lekshmiraveendranath/Spotlight

Can it support Objective c project?

suhasPathakChoice opened this issue · 3 comments

My project is developed in objective -c.
I installed Spotlight using cocoapod.

It can't currently because SpotlightNode is a struct which Objective-C won't be able to see. As a temporary workaround, you could create a Swift class in the Objective-C project which wraps around SpotlightNode. Hopefully that helps.

Looking deeper, both SpotlightNode (struct) and SpotlightTarget (enum with associated values) is not compatible with Objective-C, which means at a foundational level it would take much more effort to switch everything. At the moment, a better workaround for Objective-C would be to create a Swift class exposed to Objective-C which in turn can invoke Spotlight. I will push a release over which has some cleanup code and has an example on how to do this

The latest release of Spotlight is compatible with Objective-C. Please try it out and let me know if it worked!