GeometryReader

A container view that defines its content as a function of its own size and coordinate space.

ComponentiOS 13.0+macOS 10.15+tvOS 13.0+watchOS 6.0+GeometryReader in SwiftUI

Declaration

React
import { GeometryReader } from 'swiftui-react-native';
Swift
@frozen nonisolated struct GeometryReader<Content> where Content : View

Initializers

One SwiftUI initializer backs <GeometryReader>.

React
<GeometryReader>
  children?: ReactNode | ((arg0: SwiftUI.GeometryProxy) => ReactNode)
</GeometryReader>
Swift
nonisolated init(
    @ContentBuilder content: @escaping (GeometryProxy) -> Content
)

Also takes the common view props: modifiers, style and testID.

Overview

This view returns a flexible preferred size to its parent layout.

From Apple’s SwiftUI documentation. Code samples there are Swift.

Relationships

Conforms to

  • View

See also

More in Layout.