Updated for Xcode 13
Open a code file, such as *.swift, and press the second from the right button in the top right corner. Then click on Minimap:

In older versions of Xcode, this looked as follows:
Updated for Xcode 13
Open a code file, such as *.swift, and press the second from the right button in the top right corner. Then click on Minimap:

In older versions of Xcode, this looked as follows: