My code is not in a list. I added an enter line before my code and indented by 4 spaces using ctrl + K, so why am I still getting this error: "Please indent all code by 4 spaces"?

enter image description here

My code registers as code in the preview of the question enter image description here

I referenced this question about formatting code NOT in a list and this question about formatting code in a list

  • I even tried attaching a screenshot of my code and got the same error. Pic: postimg.org/image/ftzbtlvuf – Alex Jul 11 '17 at 3:42
  • @Gnemlock Pic: postimg.org/image/kqn7fri55 – Alex Jul 11 '17 at 3:47
  • I also wonder if the warning actually appears directly at the questionable line. Where you have self.setSearchFieldBackgroundImage{#imageLiteral{resourceName: "SearchFieldBackground"), for: UIControlState.normal), could you move "SearchFieldBackground"), for: UIControlState.normal) to a separate line, and indent it further, as opposed to allowing word wrapping to move it to the next line? – Gnemlock Jul 11 '17 at 4:42
  • Take special note of the position of the error; I believe, should this be the culprit, other lines will still flag the error; but you should notice that the position of the error display moves. – Gnemlock Jul 11 '17 at 4:43

I asked the Stack Overflow Team and they told me, "The system sometimes picks up the image formatting erroneously when there are multiple images in a row." When I removed one image, I was able to post the question. Unfortunately, even when I tried to edit the question to include the removed image, I got the same error. Guess it's a glitch that Stackoverflow hasn't had time to fix ¯\_(ツ)_/¯

  • Use a bulleted list format, or newlines in between. – Martijn Pieters Mar 23 '18 at 11:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .