Last active
June 6, 2018 06:17
-
-
Save baquaz/80626a7de2ab070152ac5315591d5432 to your computer and use it in GitHub Desktop.
Another way to remove item from collection
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
| guard let index = items.index(where: {$0 == item}) | |
| else { | |
| return | |
| } | |
| items.remove(at: index) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment