Day #37

Some Cool Swift Changes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
// Old Swift loop
for var i = 0; i < 100; i++ {}

// Swift 3?+ loop
for i in 0..<100 {}

// Old range operator (this was from the beta of swift)
let someRange = 1..10

// New range operator
let someRange = 1..<10

Originally published 09/22/2021 https://pittcsc.org/, republished 09/09/2022.

Licensed under CC BY-NC-SA 4.0
Last updated on Sep 22, 2021 00:00 UTC
Built with Hugo
Theme Stack designed by Jimmy