In this post, We will share how to use the loop over an array in Swift with an example. This is a basic program in Swift programming language. If you are Swift beginners or want to start learning Swift programming language, then this program will help you to understand the basic concept of Swift programming.
In the below example, we have shared a swift program to show you how to execute a loop over an array.
Copy the below program and create a file named “LoopProgram.swift” and execute it.
let numbers = [10, 20, 25, 4, 5]
for number in numbers
Liked this program? Do Like & share with your friends.
If you like FreeWebMentor and you would like to contribute, you can write an article and mail your article to [email protected] Your article will appear on the FreeWebMentor main page and help other developers.