📦Anchor<T>

  • Anchor<T> is an opaque type that holds a value of type T, and T can be either CGRect or CGPoint.

  • use Anchor<CGRect> to access the bounds of a view,

  • use Anchor<CGPoint> for other view properties such as top, topLeading, topTrailing, center, trailing, bottom, bottomLeading, bottomTrailing and leading.

這個物件其實是給 GeometryProxy 用的。 👉 詳見:Anchor Preferences

Last updated

Was this helpful?