Skip to content

Commit dfef87b

Browse files
committed
Edit README
1 parent 173db08 commit dfef87b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,13 @@ import GetLaid
165165
The generic function `addForAutoLayout` adds a subview and prepares it for AutoLayout. It returns the subview it takes as its exact type. Use this function to add subviews:
166166

167167
~~~swift
168-
class List: NSView {
169-
override init(frame frameRect: NSRect) {
170-
super.init(frame: frameRect)
171-
header.constrainToParentExcludingBottom()
168+
class List: UIView {
169+
// ... other code, including call to addSubviews() ...
170+
171+
func addSubviews() {
172+
addForAutoLayout(header) >> allButBottom // add header to the top
172173
}
173-
private lazy var header = addForAutoLayout(Header()) // of type Header
174+
private let header = Header()
174175
}
175176
~~~
176177

0 commit comments

Comments
 (0)