Click here to Skip to main content
15,746,108 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to create an array where the data is coming from callback. so need to create an array with all the values i got from the callback. this is used to display in fronted UI in iOS using Swift.

Thanks for the help....
Sergey Alexandrovich Kryukov 25-Dec-14 1:41am    
You did not even indicate what language you are using...
N.Ravi Raj 25-Dec-14 1:57am    
Sorry for that. Its in Swift Language IOS and i am using Xcode for developing.
Sergey Alexandrovich Kryukov 25-Dec-14 11:31am    
Nothing to sorry about; I'm sorry; this is my fault that I forgot that there is such language as Swift, which I'm almost unfamiliar with.

1 solution

As you can see from original documentation, Swift arrays are very flexible, so you can add elements to the array using the method append or the operator '+=':[^].

This way, you can add the data which comes from your callback (whatever it is) as array elements.

Share this answer
Volynsky Alex 25-Dec-14 15:34pm    
Nice Sergey Alexandrovich!
Sergey Alexandrovich Kryukov 25-Dec-14 16:29pm    
Thank you, Alex, but it's not much; I have a very vague idea how to use this language. :-)
Volynsky Alex 25-Dec-14 17:51pm    
In my opinion, this language is a little easier than the Objective-C language. It's good for game creation, for example

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900