add number +1 to array every time a func is called

My swift codes below’s goal is to add +1 to the array every time the func is called. So right now the array is 0,1,2,3,4. When the func is called the next 3 numbers that should be added to the array are 5,6,7. The objc func is listed below. There is not a lot of code below but that is all that is needed.

var arr = [0,1,2,3,4] @ojbc func() { //add to arr +1 } 
Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.