4

I've been the last week trying to serialise all of the classes of one iOS project (Objective-C).

Due to I use to do it in Android projects with Avro (Apache) library, I've been trying to do the same in the iOS project, however, the first thing that I noticed is that there is not too much information about Avro in iOS.

First thing I tried: Implement the library ObjectiveAvro using CocoaPods but some classes in the library Avro C were not found when imported.

Second thing I tried: Remove and do again the previous process but this time only with the Avro C library but the same error appeared.

Third thing I tried: Implement BlueSteel framework using Carthage. This is a swift library but I wanted to try if I could use it somehow in an Objective-C project. I couldn't.

I just need to serialise and deserialise data providing a schema as you can do with Avro (Android) in an Objective-C project and the last thing that I want to do is convert the whole project to Swift.

So do you know what's the current way to do that in Objective-C?

CPI
  • 786
  • 1
  • 5
  • 18

1 Answers1

2

I could figure it out how to do the Third thing I tried:

Basically, it's necessary to import the library through Carthage, then create a new Swift class which is the one that is going to "talk" with the Swift library, due to we are in an Objective-C project. XCode will ask you to add a "header-class" and press "yes".

Then it's as simple as using the Swift to call the library methods and call the Swift class from the current classes. Swift class in Objective-C project

Finally just to inform that the BlueSteel framework is a nightmare due to is really limited and really poor documented therefore I still don't know a real alternative.

However, if you're going to use it, have in mind that the classes are not autogenerated so you need to do manually the conversion to Avro and sign results.

CPI
  • 786
  • 1
  • 5
  • 18