I have following struct:
public protocol SuperModel { // empty protocol } struct ModelOne: SuperModel { struct SubModelOne { var someVar: Dou
First downcast the self.data to ModelOne then call setSub function
if var data = self.data as? ModelOne { data.setSub(ModelOne.SubModelOne(someVar: 2, othervar: 1)) }