ios - SwiftUI Get Coordinates of TextField or any View - Stack Overflow

PHOTO EMBED

Mon Oct 10 2022 14:49:33 GMT+0000 (Coordinated Universal Time)

Saved by @Nerkyator #swift

                        .background(GeometryReader { gp -> Color in
                            let rect = gp.frame(in: .named("OuterV")) // < in specific container
                            // let rect = gp.frame(in: .global) // < in window
                            // let rect = gp.frame(in: .local) // < own bounds
                            print("Origin: \(rect.origin)")
                            return Color.clear
                        })
content_copyCOPY

https://stackoverflow.com/questions/61355475/swiftui-get-coordinates-of-textfield-or-any-view