Skip to content

Instantly share code, notes, and snippets.

@inamiy
Created November 5, 2019 09:41
Show Gist options
  • Save inamiy/303af55abae2ef716e1b39a0d0e8656d to your computer and use it in GitHub Desktop.
Save inamiy/303af55abae2ef716e1b39a0d0e8656d to your computer and use it in GitHub Desktop.
// Xcode 11.1 indent style
[1, 2, 3]
.filter { x in
x.isMultiple(of: 2)
}
.map { $0 }
.map { $0 }
[1, 2, 3]
.filter { x in
x.isMultiple(of: 2)
} // adding comment here indents the next method-chain
.map { $0 }
.map { $0 }
[1, 2, 3]
.filter { x in
x.isMultiple(of: 2)
}
.map { $0 } // or adding comment here
.map { $0 }
[1, 2, 3]
.filter { x in
x.isMultiple(of: 2)
}
.map { $0 }
.map { $0 }
.map { $0 } // why last line has indent?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment