Skip to content

Commit 6a9d0b7

Browse files
author
JWI
committed
a
1 parent ac42468 commit 6a9d0b7

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

Sources/UIKitBackend/UIKitBackend+Container.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ final class ScrollWidget: ContainerWidget {
88
private var childHeightConstraint: NSLayoutConstraint?
99

1010
private lazy var contentLayoutGuideConstraints: [NSLayoutConstraint] = [
11-
scrollView.contentLayoutGuide.leadingAnchor.constraint(equalTo: child.view.leadingAnchor),
12-
scrollView.contentLayoutGuide.trailingAnchor.constraint(equalTo: child.view.trailingAnchor),
13-
scrollView.contentLayoutGuide.topAnchor.constraint(equalTo: child.view.topAnchor),
14-
scrollView.contentLayoutGuide.bottomAnchor.constraint(equalTo: child.view.bottomAnchor),
11+
scrollView.leadingAnchor.constraint(equalTo: child.view.leadingAnchor),
12+
scrollView.trailingAnchor.constraint(equalTo: child.view.trailingAnchor),
13+
scrollView.topAnchor.constraint(equalTo: child.view.topAnchor),
14+
scrollView.bottomAnchor.constraint(equalTo: child.view.bottomAnchor),
1515
]
1616

1717
override func loadView() {

Sources/UIKitBackend/UIKitBackend+Window.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ final class RootViewController: UIViewController {
7070

7171

7272
/*NSLayoutConstraint.activate([
73-
child.view.widthAnchor.constraint(equalTo: view.safeAreaLayoutGuide.widthAnchor),
74-
child.view.heightAnchor.constraint(equalTo: view.safeAreaLayoutGuide.heightAnchor),
73+
child.view.widthAnchor.constraint(equalTo: viewAnchor.widthAnchor),
74+
child.view.heightAnchor.constraint(equalTo: viewAnchor.heightAnchor),
7575
])*/
7676

7777
child.view.frame = view.bounds
@@ -116,7 +116,7 @@ extension UIKitBackend {
116116

117117
//MARK: changed for now, understandably will have to be patched.
118118
if #available(iOS 11, *) {
119-
//let size = window.safeAreaLayoutGuide.layoutFrame.size
119+
//let size = windowAnchor.layoutFrame.size
120120
//return SIMD2(Int(size.width), Int(size.height))
121121
let size = window.bounds.size
122122
return SIMD2(Int(size.width), Int(size.height))

Sources/UIKitBackend/Widget.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@ extension WidgetProtocolHelpers {
3636
}
3737

3838
if let leftConstraint,
39-
leftConstraint.secondAnchor === superview.safeAreaLayoutGuide.leftAnchor
39+
leftConstraint.secondAnchor === superview.leftAnchor
4040
{
4141
leftConstraint.constant = CGFloat(x)
4242
leftConstraint.isActive = true
4343
} else {
4444
self.leftConstraint?.isActive = false
4545
let leftConstraint = view.leftAnchor.constraint(
46-
equalTo: superview.safeAreaLayoutGuide.leftAnchor, constant: CGFloat(x))
46+
equalTo: superview.leftAnchor, constant: CGFloat(x))
4747
self.leftConstraint = leftConstraint
4848
// Set the constraint priority for leftConstraint (and topConstraint) to just
4949
// under "required" so that we don't get warnings about unsatisfiable constraints
@@ -62,14 +62,14 @@ extension WidgetProtocolHelpers {
6262
}
6363

6464
if let topConstraint,
65-
topConstraint.secondAnchor === superview.safeAreaLayoutGuide.topAnchor
65+
topConstraint.secondAnchor === superview.topAnchor
6666
{
6767
topConstraint.constant = CGFloat(y)
6868
topConstraint.isActive = true
6969
} else {
7070
self.topConstraint?.isActive = false
7171
let topConstraint = view.topAnchor.constraint(
72-
equalTo: superview.safeAreaLayoutGuide.topAnchor, constant: CGFloat(y))
72+
equalTo: superview.topAnchor, constant: CGFloat(y))
7373
self.topConstraint = topConstraint
7474
topConstraint.priority = .init(UILayoutPriority.required.rawValue - 1.0)
7575
topConstraint.isActive = true

0 commit comments

Comments
 (0)