If you need to read a very large file you’ll want to stream it so you’re not loading the entire thing into memory at once. Here’s a snippet for doing that.
If you need to have some data in an external file and read it in playgrounds, here’s how to do it in Xcode 11.3 using Swift 5.1.
Here’s a simple method for getting the reverse of a positive integer.
If you need to continue looping over an array after you’ve reached the end, you can use the modulo operator to start the index back at 0.