Answer the question
In order to leave comments, you need to log in
How to populate an array in a function?
There is an array var Array =[String]() there is a function DownloadData() The array (self.Array.append(var)) should be filled in the function, but it is not filled. I output the array after the function is executed, it is empty. Why and how to fix this
? not applicable function returns nothing
Answer the question
In order to leave comments, you need to log in
I still recommend reading the book on Swift, where you will find answers to many questions.
Use inout parameters. But that's pretty bad manners. The return value option is much better. And you can always return a tuple (tuple)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question