Skip to content

Instantly share code, notes, and snippets.

@DonMag
Created October 3, 2016 13:04
Show Gist options
  • Select an option

  • Save DonMag/5ba103cf72818bc970ff5b95374bdf13 to your computer and use it in GitHub Desktop.

Select an option

Save DonMag/5ba103cf72818bc970ff5b95374bdf13 to your computer and use it in GitHub Desktop.
let elements = ["a", "b", "c", "d", "e"]
for (index, element) in elements.enumerate() {
print("i \(index) e \(element)")
if element == elements.last {
print("last = \(element)")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment