Friday, October 9, 2026
HomeiOS DevelopmentDecide when animating UIView is intersecting/overlapping one other view in Swift for...

Decide when animating UIView is intersecting/overlapping one other view in Swift for iOS

[ad_1]

I’ve a ViewController with 5 UILabels in my Swift undertaking for iOS, as follows:

enter image description here

I am animating the primary UILabel (Label 1) so it slides all the best way to the proper of the display screen, and I need to have the ability to decide when it intersects with every of the labels to the proper of it. I attempted utilizing CADisplayLink to get the x and y coordinates with every display screen refresh, however CADisplayLink is not detecting animations the best way I believed it could.

Is there a approach to do that? I need to have the ability to detect when Label 1 and Label 2 have the identical heart level (after which Label 1 and Label 3, and so forth…)

CADisplayLink is not doing this for me. What ought to I be utilizing?

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments