Skip to content

Instantly share code, notes, and snippets.

@mlvea
Created March 15, 2015 02:03
Show Gist options
  • Save mlvea/dd7fd837bde3ce98c17a to your computer and use it in GitHub Desktop.
Save mlvea/dd7fd837bde3ce98c17a to your computer and use it in GitHub Desktop.
Arrays in swift
//My favourite movies
var favouriteMovies = ["Inception","Theory of Everything","Fifty Shades of Grey"]
//I have new favourite
favouriteMovies += "PK"
//Ohh forgot The Hunger Games
favouriteMovies += ["Hunger Games","Catching Fire","Mocking Jay"]
//Hmm. Replace Fifty Shades and PK with new favourites I happened to watch recently -> Interstellar and The Social Network
favouriteMovies[2...3] = ["Instersteller","The Social Network"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment