I want to send struct data from my watchOS-app to my iOS-app using WatchConnectivity. As I have understood, you can only send property list objects, hence I must convert my struct somehow. I tried converting it into a NSDictionary, and also make it a Codable struct, but it doesn't work since I have properties that does not conform to the Codable prototocols. Any suggestions on how this can be solved in a good way?
I'm using XCode Version 10.1 and Swift 4.2.
Here is my struct:
struct Storage {
var acc: Acc
struct Acc {
var x: [Double] = []
var y: [Double] = []
var z: [Double] = []
}
var gyro: Gyro
struct Gyro {
var x: [Double] = []
var y: [Double] = []
var z: [Double] = []
}
var mag: Mag
struct Mag {
var x: [Double] = []
var y: [Double] = []
var z: [Double] = []
}
var pulse: [Double] = []
var quaternion: Quaternion
struct Quaternion {
var w: [Double] = []
var x: [Double] = []
var y: [Double] = []
var z: [Double] = []
}
}