Skip to content

Instantly share code, notes, and snippets.

@sheafk
Created August 5, 2016 13:07
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/e303c8cf72bcc9d0b8e8cc91cf2c88bf to your computer and use it in GitHub Desktop.
Save sheafk/e303c8cf72bcc9d0b8e8cc91cf2c88bf to your computer and use it in GitHub Desktop.
An example of searching by Keyword
//Search by Keyword
let savedApartments = [
"apt1" : "The unit comes with stainless steel appliances, a full-sized refrigerator, plenty of storage, a gas oven, a gas range, and a dishwasher.The bedroom has hardwood floors and a window that opens.", "apt2" : "you will love it", "apt3" : "So many great amenities"]
for (name, description) in savedApartments {
if description.containsString("a window that opens") {
print(name)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment