Skip to content

Instantly share code, notes, and snippets.

@sheafk
Created August 5, 2016 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sheafk/916dfc1988a8a7c58867abf02fdeb930 to your computer and use it in GitHub Desktop.
Save sheafk/916dfc1988a8a7c58867abf02fdeb930 to your computer and use it in GitHub Desktop.
Example of using the filter function
//Greater Than or Less Than
var rentPerMonth = [["rent" : 2200], ["rent" : 2350], ["rent" : 2300], ["rent" : 2490]]
var filteredRent = rentPerMonth.filter({
$0["rent"] < 2000
})
print(filteredRent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment