Get width of a view using in SwiftUI
The only available mechanism to get the dimension of a view, that is auto-resized by SwiftUI, is the GeometryReader. The GeometryReader is a proxy view that returns the dimensions of the container in which your view gets rendered. struct SomeView: View { @State var size: CGSize = .zero var body: some View { VStack { … Read more