myData, so most likely have an array of multiple
MyData instances, and its type is
Array<MyData>). You can verify in Xcode by option+clicking
myData, and it'll show you its data type.
You should improve the name of
MyData. It's fine for a place-holder in a simple demo (akin to the famous
baz), but it's not at all descriptive of the intent of that struct. Technically, you won't find a single thing on a computer system that isn't data, in one form or another.
Strings, movies, spreadsheets, heck, even programs and compilers, are all just data™.
A better name might be
Sentence (after all, you have a function named
retrieveRandomSentence(), you would think it returns a
Sentence and not a
HamBurger. However, that doesn't seem quite right either, because it has a
definition field, and sentences don't have definitions. I would think it's just a
Word, like from a dictionary, then having a
definition field makes sense, but then
wordCount doesn't really make much sense. If you give more context on your problem domain, perhaps we can help you come up with a better name, but ultimately its up to you to pick something that's most useful and descriptive.
Never forget that the audience of your code isn't just the compiler, it's other people reading it. So your identifiers should go beyond the minimum necessary (like the way physicists always use a ton of single-letter variable names), and be useful in conveying information to readers who aren't already familiar with your code. It's important to note that you yourself will be one of those readers who aren't familiar with the code, because you'll forget everything that's "obvious" and "in your head" today after say, 3-6 months.