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
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,6 @@ addSubview(button)
33
33
button.constrain(.width, constant: 100)
34
34
35
35
// constrain view to superview
36
-
37
36
let container =UIView()
38
37
addSubview(container)
39
38
container.constrain(.leading, to: .leading, of: superview)
@@ -50,8 +49,7 @@ Another flavor creates constraints using anchors just like the anchor api’s fi
50
49
addSubview(button)
51
50
button.constrain(.widthAnchor, constant: 100)
52
51
53
-
// constrain view to superview**
54
-
52
+
// constrain view to superview
55
53
let container =UIView()
56
54
addSubview(container)
57
55
container.constrain(.leadingAnchor, to: leadingAnchor)
@@ -189,19 +187,20 @@ final class ColorsTests: XCTestCase {
189
187
190
188
### 3. UIScrollView extensions to assist with keyboard avoidance
191
189
192
-
#### `FormViewController` is a view controller with a scrollable content area that will automatically avoid the keyboard for you. It is a good choice for views that have inputs (e.g. login or onboarding). Even for views without inputs, it is still quite useful for managing the creation of a `UIScrollView` and a `contentView` set within it, so that you can focus on your content and not have to code a scrollView for every view.
190
+
#### FormViewController
193
191
194
-
<aside>
195
-
💡 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.
196
-
</aside>
192
+
`FormViewController` is a view controller with a scrollable content area that will automatically avoid the keyboard for you. It is a good choice for views that have inputs (e.g. login or onboarding). Even for views without inputs, it is still quite useful for managing the creation of a `UIScrollView` and a `contentView` set within it, so that you can focus on your content and not have to code a scrollView for every view.
197
193
198
-
#### `UIScrollview` Extensions
194
+
#### UIScrollview Extensions
199
195
200
196
Want to have a scrollview that avoids the keyboard, but you can’t use `FormViewController`? Most of its functionality is a simple extension to `UIScrollView`. You can add keyboard avoidance to any scroll view like so:
201
197
202
198
```swift
203
199
scrollView.registerKeyboardNotifications()
204
200
```
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.
0 commit comments