If you are using SwiftUI elements and want to determine the location of an element on the screen, then you will need to use GeometryReader. However GeometryReader values cannot be accessed externally by parent elements unless you use the PreferenceKey method.
Useful links to references:
- Stack Overflow, get size of child
- Swift-UI Lab, communicating with the view tree
- Stack overflow, make equal-width swiftui views in list rows
- swiftmajid, the magic of view preferences in swiftui
- Medium, how to get content offset from scrollview
- [objc.io, thinking in swift - preference and geometry readers](