title: Auto-formatting Swift in Xcode for a blind developer
body: <p>The answers to <a href="https://stackoverflow.com/q/26993977/575530">How to use code formatter in Xcode for Swift?</a> suggest that Xcode has the ability to auto-format swift code and that the feature can be invoked using <kbd>⌃</kbd>+<kbd>I</kbd> (Ctrl-I)</p>
  
  <p>When I try it on the following Swift function absolutely nothing changes</p>
  
  <pre class="lang-swift prettyprint-override"><code>func displayGuesses(){
      replaceWord = ""
      for character in chosenWord!{
          if guesses.contains(String(character)) {
              replaceWord.append(character)
          }
          else{
              replaceWord.append("_")
          }
              }
  
      guessLabel.text = replaceWord
  }
  </code></pre>
  
  <p>I would expect it to align the curly-brace closing the for loop with the opening statement.</p>
  
  <p>Is there a feature in Xcode that would correctly format this Swift function? How do I invoke it from the keyboard?</p>
  
  <p>Note that this is not about selecting the code first. If I select the whole file first—using <kbd>⌘</kbd>+<kbd>A</kbd> (Cmd-A)—then there is still no effect.</p>
  
  <p>(N.B. You may wonder why I am writing oddly formatted code. I'm working with a blind kid who is swapping from Python on the PC to Swift on a Mac. Python uses indentation for scoping. I was excited to teach him Swift as he would not have to worry so much about indentation. But, if he wants to share code with sighted developers, then it would be handy if Xcode would tidy up the formatting for him.)</p>