Skip to content

Commit 444204c

Browse files
committed
Move anchors into guide
1 parent 9e9ad54 commit 444204c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sources/GateEngine/UI/View.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,10 +233,12 @@ open class View {
233233
public var marginInsets: Insets = .zero
234234
public private(set) lazy var margin: Layout.Guide = Layout.Guide(view: self)
235235

236-
public private(set) lazy var topAnchor: Layout.Anchor<Layout.Vertical, Layout.Location> = Layout.Anchor(view: self)
237-
public private(set) lazy var leadingAnchor: Layout.Anchor<Layout.Horizontal, Layout.Location> = Layout.Anchor(view: self)
238-
public private(set) lazy var bottomAnchor: Layout.Anchor<Layout.Vertical, Layout.Location> = Layout.Anchor(view: self)
239-
public private(set) lazy var trailingAnchor: Layout.Anchor<Layout.Horizontal, Layout.Location> = Layout.Anchor(view: self)
236+
internal lazy var layoutGuide: Layout.Guide = Layout.Guide(view: self)
237+
238+
public var topAnchor: Layout.Anchor<Layout.Vertical, Layout.Location> {self.layoutGuide.topAnchor}
239+
public var leadingAnchor: Layout.Anchor<Layout.Horizontal, Layout.Location> {self.layoutGuide.leadingAnchor}
240+
public var bottomAnchor: Layout.Anchor<Layout.Vertical, Layout.Location> {self.layoutGuide.bottomAnchor}
241+
public var trailingAnchor: Layout.Anchor<Layout.Horizontal, Layout.Location> {self.layoutGuide.trailingAnchor}
240242

241243
public private(set) lazy var centerXAnchor: Layout.Anchor<Layout.Horizontal, Layout.Location> = Layout.Anchor(view: self)
242244
public private(set) lazy var centerYAnchor: Layout.Anchor<Layout.Vertical, Layout.Location> = Layout.Anchor(view: self)

0 commit comments

Comments
 (0)