You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,17 +45,17 @@ Another flavor creates constraints using anchors just like the anchor api’s fi
45
45
46
46
```swift
47
47
// constrain a button's width to 100
48
-
let button =UIButton()
49
-
addSubview(button)
50
-
button.constrain(.widthAnchor, constant: 100)
48
+
let button =UIButton()
49
+
addSubview(button)
50
+
button.constrain(.widthAnchor, constant: 100)
51
51
52
52
// constrain view to superview
53
-
let container =UIView()
54
-
addSubview(container)
55
-
container.constrain(.leadingAnchor, to: leadingAnchor)
56
-
container.constrain(.trailingAnchor, to: trailingAnchor)
57
-
container.constrain(.topAnchor, to: topAnchor)
58
-
container.constrain(.bottomAnchor, to: bottomAnchor)
53
+
let container =UIView()
54
+
addSubview(container)
55
+
container.constrain(.leadingAnchor, to: leadingAnchor)
56
+
container.constrain(.trailingAnchor, to: trailingAnchor)
57
+
container.constrain(.topAnchor, to: topAnchor)
58
+
container.constrain(.bottomAnchor, to: bottomAnchor)
59
59
```
60
60
61
61
There are overrides to handle the common use case of placing one view below another or to the trailing side of another:
@@ -199,7 +199,7 @@ Want to have a scrollview that avoids the keyboard, but you can’t use `FormVie
199
199
scrollView.registerKeyboardNotifications()
200
200
```
201
201
<aside>
202
-
💡 Almost every full-screen view in your app that contains any text should be a scroll view because of the vagaries of localization, Dynamic Type, potentially small screen sizes, and landscape mode support.
202
+
💡 Almost every full-screen view in your app that contains any text should be a vertical scroll view because of the vagaries of localization, Dynamic Type, potentially small screen sizes, and landscape mode support.
0 commit comments