|
In the following code, I'm trying to animate an How can I animate a view above all other views without affecting other views' position? View
Animation
Image |
|
Hi, You have to set the background of the uiView to clear so you dont see it when the ball moves.
|
|
Oh shoot, something so simple, you're my hero. Thank you for the extra improvements; I had to move the Quick question, how hard would it be to make the endPoint location dynamic? In other words, reference other views' x and y locaiton as the endPoint, for when in bigger/smaller screens. Thanks a LOT! |
|
Well as far as bigger/smaller screens i tried it with the iPad simulator and it was still hitting the target, the starting point on the other hand was moving around depending on the screen size to fix it just add this line
now if you add or remove views thats another problem, maybe you can try to get the targets position using a geometry reader but im not sure how to do it. |
|
You're right, the target is hit regardless of screen size, wow, I didn't try that until now. Thanks a lot for your help, it really helped a lot! |
SPONSORED Let’s face it, SwiftUI previews are limited, slow, and painful. Judo takes a different approach to building visually—think Interface Builder for SwiftUI. Build your interface in a completely visual canvas, then drag and drop into your Xcode project and wire up button clicks to custom code. Download the Mac App and start your free trial today!
Sponsor Hacking with Swift and reach the world's largest Swift community!
You need to create an account or log in to reply.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.