Trying To have An intersection On The Left Side

I'm trying to have my label theView intersect another label called tot.

if theView.frame.intersects(tot.frame.?.?)

but I want the intersection to be the left side of the tot. How can I go about doing that?
You could easily make the comparison by yourself. It is pretty easy to test if the 2 rects intesect and which is on the left of the other (just comaring the xmin).

Tell if there is still a difficulty.
Is this what you are looking for?

Code Block
if theView.frame.minX < tot.frame.minX && theView.frame.intersects(tot.frame)

Is there a way to make the intersection only at outside of the shape and not have it go inside?
You need to explain your requirement much more precisely.
If possible with 2 drawings like this, one showing an OK case, one a non OK.
(note that drawing with this editor which is not WYSIWYG and pretend to be smart but is just dumb, is absolutely awful)
And tell if the labels are aligned vertically or not.
Code Block
_________________________
| tot |
______________________ |
| L____________ I__________|
| View |
_______________________|

In this case, is intersection on the left ?
Code Block
_________________________
| tot |
_________________________________I_______
| L_________________________| |
| View |
_________________________________________|


And in this case ?
I want it like this view is white black is tot ▭▬ not like this ❏ if that makes any sense. I don't want the labels overlapping.


I don't want the labels overlapping.

Then it is not called as intersection. As already noted, you need to write some logic yourself.
Im wondering if there is a touch modifier I can add so that it touches tot but does not overlap it.

Im wondering if there is a touch modifier I can add so that it touches tot but does not overlap it.

No such modifiers and no simple way to detect such touches.
I do not understand what you really want to do. Just want to layout the views? Or user can move any of the views?

I want it like this view is white black is tot ▭▬ not like this ❏

So test
Code Block
theView.frame.maxX < tot.frame.minX


That guarantees they do not intersect.
If you want them to be aligned vertically, add an extra test on vertical with either minY, midY, maxY.

But your posts are not very clear. Do you want them to intersect or not ?
Accepted Answer
I figured it out I decided to have it intersect but then after when it does go to a position where it's right next to tot using CGPoint. Thank you to everyone that helped.
You solved it. Great.

But your feed back does not explain the solution. And you do just as if you provided the right answer…

Did you implement any part of what all of us told you ?
Trying To have An intersection On The Left Side
 
 
Q