Networking with URLSession · Understanding Concurrency | raywenderlich.com


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/7476-networking-with-urlsession/lessons/2

Wow, what a nice lecture about concurrency!

Thanks so much, I’m glad you enjoyed it!

Isn’t this a simpler way to determine if a number is prime, or is it wrong?

func isPrime(number: Int) → Bool {
if number <= 1 {
return false
}
if number <= 3 {
return true
}
var i = 2
while (i < number) {
if number % i == 0 {
return false
}
i = i + 1
}
return true
}