Created
July 3, 2015 10:00
-
-
Save ivangodfather/ce5bc2544d3739aaaa96 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var fruits = ["apple", "banana"] | |
| var names = ["ivan", "john", "maria"] | |
| var mainArray = [fruits, names] | |
| // i want to return true if theres a name/fruit that is "john" | |
| func search() -> Bool { | |
| for object in mainArray { | |
| if (object.filter { $0 == "john" }).count > 0 { | |
| return true | |
| } | |
| } | |
| return false | |
| } | |
| search() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment