Closed diuming closed 4 years ago
Class inheritance works just fine, but you have to rewrite your required init(from decoder: Decoder). This is a bit odd because the Model protocol conforms to Codable protocol and subclass inherits from a class that also conforms to the same protocol. Therefore encoding and decoding for basic data types should be working out fo a box.
You also have to override func encode(to encoder: Encoder) throws in the case that you want to use save or update function.
@igorL-Pg got it.
I try to use my
subclass
ClassB
conforms withModel
. Then create database table usingcreateTableSync()
function. but onlyid
andvalue3
's are created.how about
value1
andvalue2
ofClassA
?