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.
Editorial Staff at FreeWebMentor is a team of professional developers leads by Prem Tiwari View all posts by Editorial Staff