currently I have a class that conforms to NSCoding containing a UIBezierPath and a UIColor.
required init(coder aDecoder: NSCoder) {
super.init()
self.lineColor = aDecoder.decodeObjectForKey("color") as! UIColor
self.bezierPath = aDecoder.decodeObjectForKey("bezier") as! UIBezierPath
}
func encodeWithCoder(aCoder: NSCoder) {
aCoder.encodeObject(lineColor, forKey: "color")
aCoder.encodeObject(bezierPath, forKey: "bezier")
}
I achieve this with NSKeyedArchiver
NSKeyedArchiver.archivedDataWithRootObject(path)
and save it on a server (parse.com) I can unarchive it with no problem with iOS. But how to be compatible with Android?
You'd need to convert the paths and colours into some common format and export it in a common format. Something like SVG including the RGBA values.
UIBezierPath
and keyed archiving are iOS specific items with private binary implementations - trying to work with them on Android will take you a long time and not be future proof.