You need to actually initialize syncModelRecord
. Try this:
let syncModelRecord = SyncModelRecord(date: String(Int64(syncTimestamp!)), shakeState: 0)
dummySyncModelRecordArray.append(syncModelRecord!)
Another tip maybe worth exploring, you can directly decode a date and specify the decoder’s strategy for it (in your case secondsSince1970
)
solved How to make an array using dummy values from Struct Modal class in Swift iOS