How to use For Loops in Swift | Swift Basics #15

preview_player
Показать описание
Master the usage of for-each loops in Swift with this comprehensive tutorial! Learn how to iterate over arrays, sets, dictionaries, and other collections using for-each loops. Discover the power of simplified syntax and improved readability when working with loops in Swift. Gain a deep understanding of how for-each loops can streamline your code and make it more efficient. Start your journey to becoming a proficient Swift developer today and leverage the flexibility and convenience of for-each loops in your projects!

🤙 WELCOME BACK 🤙

00:00 Loops
00:00 Intro
01:44 Welcome back!
02:37 For Loops
05:06 Looping on an array of data
06:28 Checking data in the loop
09:24 Enumerated arrays
11:25 Control flow (break & continue)
13:56 Other types of loops
15:33 Wrapping up
Рекомендации по теме
Комментарии
Автор

NIce style of explanation . . Learning a lot from you, mister. Keep doing good work.

gregas
Автор

I noticed in your video title you mention For Each loops but there was no mention or demonstration of ForEach in your video. Just thought it would have been nice to include in the lecture.

Nice_One
Автор

Quick question: on your screen when you loop from 0 to <100 to the right it shows (100 times), but on my screen it shows "99\n". Why the difference - I'm positive my code is the same as yours.

CMessineo
Автор

im'm trying to get my loop to stop and rerun once a condition is met

hasstv
Автор

for (index, lesson) in allLesson.enumerated(){
if index == 1 {
break
}
print("index: \(index) || lesson: \(lesson)")
}

why do this return a different output then this ?

for (index, lesson) in allLesson.enumerated(){
if index == 1 {
print("index: \(index) || lesson: \(lesson)")
break
}

thedrenkemp
Автор

let bestTeacherEver: String = "Nick"
print(bestTeacherEver)

besmart.