IntrepidPursuits/swift-style-guide

How do we style comma delimited guard statements?

Closed this issue · 4 comments

This can be done in a few ways, for example:

guard
  let someVar = someClass.method(),
  someOtherVar = someOtherClass.otherMethod()
  else { return }
guard
  let someVar = someClass.method(),
  let someOtherVar = someOtherClass.otherMethod()
  else { return }

Whatever we do here, it should also apply to if statements. I'm personally partial to the let on each statement for the way it aligns, but I also like the brevity of omitting it.

+1 for 2 from me

I agree with @loganwright here. I prefer the second one, but both have their merits.

I think we'll move forward w/ let on each line. Thanks for the tiebreaker @paulrolfe

This is now covered in the style guide, so I'm closing this issue.