The way I deal with this is to put the left parenthesis at the end of a line and the right parenthesis at the start of a line, so that the contents of the condition have their own lines, like this:
if (
ptTarget.x > fLeft
&& ptTarget.x < fRight
&& ptTarget.y > fTop
&& ptTarget.y < fBottom
) {
// ...
}
You'll find that Xcode won't reformat that by changing the indentation (for example, if you type the curly brace, or if you cut the whole thing and paste it elsewhere in your code).
Now, what lines up in my approach is the line starts, not the repeated ptTarget. It happens that in the case of this particular code, you can get that simply by putting the && at the end of the preceding line:
if (
ptTarget.x > fLeft &&
ptTarget.x < fRight &&
ptTarget.y > fTop &&
ptTarget.y < fBottom
) {
// ...
}
You can also get a more elaborately aligned arrangement by inserting your own tabs within each line; this is a bit nutty, but you could write it something like this:
if (
ptTarget.x > fLeft &&
ptTarget.x < fRight &&
ptTarget.y > fTop &&
ptTarget.y < fBottom
) {
// ...
}
There are many possible variants on this. For example, you could put each && on its own line!
if (
ptTarget.x > fLeft
&&
ptTarget.x < fRight
&&
ptTarget.y > fTop
&&
ptTarget.y < fBottom
) {
// ...
}
You can be quite elaborate, all depending on how "clear" or "readable" you want the code to be (for yourself or for other future programmers who may need to read / edit the code).