Skip to content

Commit 6647e0c

Browse files
committed
readme
1 parent 5691f18 commit 6647e0c

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

README.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,18 @@ class ViewController: UIViewController {
5858

5959
}
6060
```
61-
For further customization of views and constraints, implement `LayoutDelegate`.
61+
For further customization of views and constraints, implement some or all lambdas in `configure` clause as follows:
62+
```swift
63+
try? Layout(name: "layout").configure {
64+
// customize format options
65+
$0.formatOptions = { (id) -> NSLayoutConstraint.FormatOptions in [] }
66+
// provide view yourself (if the class does not have default initializer) or fall back to the default implementation
67+
$0.viewOfType = { (type, id) -> UIView? in return Layout.view(of: type) }
68+
// configure a newly created view
69+
$0.didCreate = { (view, id) -> Void in return }
70+
}
71+
.inflate(in: view)
72+
```
6273

6374
![alt JSONLayout](https://github.com/maxvol/JSONLayout/blob/master/JSONLayout.jpg?raw=true)
6475

0 commit comments

Comments
 (0)