Structure

Anchor.Source

A type-erased geometry value that produces an anchored value of a given type.

Declaration

@frozen struct Anchor<Value>.Source

Overview

SwiftUI passes anchored geometry values around the view tree via preference keys. It then converts them back into the local coordinate system via a LayoutContext, such as in a layout’s situate(_:updating:in:) function.

Topics

Type Properties

static var bottom: Anchor<CGPoint>.Source
static var bottomLeading: Anchor<CGPoint>.Source
static var bounds: Anchor<CGRect>.Source

An anchor source rect defined as the entire bounding rect of the current view.

static var center: Anchor<CGPoint>.Source
static var leading: Anchor<CGPoint>.Source
static var top: Anchor<CGPoint>.Source
static var topLeading: Anchor<CGPoint>.Source
static var topTrailing: Anchor<CGPoint>.Source
static var trailing: Anchor<CGPoint>.Source

Type Methods

static func rect(CGRect) -> Anchor<Value>.Source

Returns an anchor source rect defined by r in the current view.