Yo very quick and simple question, I once used a class and now can't remember what it was.
I have a messaging app and want to store the messages in something like a NSMutableArray. However, I want to add an attribute to each of the entries.
I could either go for a two-dimensional array but I don't want fixed size and NSMutableArrays aren't really made for more than 1 dimension.
Another way would be to use some kind of key-value dictionary as shown in the screenshot and add another "value" attribute for it but everything I can think of looks incredibly hacky, there must be some other way
I have no clue what you really want. I don't know swift, by cant you just create an object or datatype "message" with all the attributes you want and create your use the swift equivalent of a vector or list?
>>61935975
didn't even think of an own type, might be a bit overkill but this is what I am going to do now, cheers mate
>>61935996
Does swift have tuples, records or structs?
>>61935894
Thanks for the blog
>>61936015
I only know of structs in swift and yea that should be sufficient haha
https://www.raywenderlich.com/116714/swift-tutorial-introducing-structures
>>61936033
wat