the below is the sample code in swift.
var loadedMessages = [[Message]]()
Message is a custom class. i'm not sure what [[Message]] () is doing.
It is specifying that your variable loadedMessages
is an array of arrays that contains Message
objects. A JSON representation of loadedMessages
might look like:
loadedMessages: [
[ <Message>, <Message>, <Message> ],
[ <Message>, <Message>, <Message> ]
]
A quick Playground implementation of something similar can give you a pretty good introspection of the situation:
var foo = [[String]]()
foo.append(["bar"])
foo[0][0] // reveals "bar"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With