|
I`m trying to move this circle to the edges of the screen then determine if it is at the border of the screen and show alert. This is what I already tried: Tried offset(), now am playing with position() without luck. Tried using geometryReader didnt help I can hard code to a value of minus something which is working but want to know how to detect the edges of the screen and also to understand why this logic isnt working. To know edges of the screen I tried also using UIScreen.main.boundries I`m doing SwiftUI excersizes to get "comfortable" with SwiftUI which is a real pain.
|
|
Solved: Better solution to this problem available on stackoverFlow. [https://stackoverflow.com/questions/65512250/problem-with-position-offset-swiftui]
|
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!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.