Swift snippet #8 β€” Collection

Ritesh Gupta
Swift Snippets πŸš€
1 min readDec 12, 2016

Monday, 12th December, 2016

You can find its Gist here!

The above snippet makes accessing after & before element in a collection way easier πŸš€. If the subsequent element doesn’t exist then it simply returns nil.

Lets see its use case..

If you are wondering about the inception of Swift-Snippets or want to checkout more such snippets, you can find them here 😊

--

--