skip to Main Content

With one line guard Xcode 12 make right indentation:

guard let contentName = vod.name else {
    Log.fault("No data.")
    return
}

but with multiline, the indentation is broken:

guard let contentName = vod.name,
      let season = vod.season else {
          Log.fault("No data.")
          return
      }

Am I doing something wrong or there are someone with the same problem?

2

Answers


  1. Chosen as BEST ANSWER

    In Xcode Version 13.3.1 (13E500a) it seems to be fixed 🎉


  2. I can reproduce this with Xcode 13.1

    Interestingly it works fine for multi-line if let.

    The "Preferences/Text Editing/Indentation"-menu does not offer any option to fix this.

    I have submitted a bug report in the Apple feedback assistant (FB9958961, it’s probably non-public?).
    I am afraid that is all we can do at this point:

    • raise awareness for the issue through a Stack Overflow posting ✅
    • file a bug report ✅
    • consider using AppCode instead of Xcode …
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search