How to encode / decode Array < Array < SomeStruct > >

I need to encode and decode Array<Array<SomeStruct>>

SomeStruct is multiplexed in an Int

The former API did work:

if let format = decoder.decodeObject(forKey: someKey) as? Array<Array<SomeStruct>>  { }

But using the new API

if let format = decoder.decodeObject(of: Array<Array<Int>>.self, forKey: someKey) {

generates an error:

Cannot convert value of type 'Array<Array<Int>>.Type' to expected argument type '[AnyClass]' (aka 'Array<any AnyObject.Type>')

encoding is done as follows:

        var format = Array(repeating: Array(repeating: 0, count: 4), count: 4)
       // initialize the var
        coder.encode(format, forKey: someKey)

What is the correct syntax ?

I have tried also:

if let format = decoder.decodeObject(of: Array<any AnyObject.Type>.self, forKey: someKey) {

I get the compiler error:

Cannot convert value of type 'Array<any AnyObject.Type>.Type' to expected 
argument type '[AnyClass]' (aka 'Array<any AnyObject.Type>')

 

I then tried

if let format = decoder.decodeObject(of: [AnyClass].self, forKey: someKey) {

and got

Cannot convert value of type '[AnyClass].Type' (aka 'Array<any AnyObject.Type>.Type') to expected 
argument type '[AnyClass]' (aka 'Array<any AnyObject.Type>')

  

And a last try:

if let formatI = decoder.decodeObject(of: [AnyClass], forKey: someKey) {

and got

Cannot convert value of type '[AnyClass].Type' (aka 'Array<any AnyObject.Type>.Type') to expected 
argument type '[AnyClass]' (aka 'Array<any AnyObject.Type>')

 

What should I pass as of: argument?

How to encode / decode Array &lt; Array &lt; SomeStruct &gt; &gt;
 
 
Q