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
+101-7Lines changed: 101 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,13 +26,17 @@ Swift Declarative Configuration (SDC, for short) is a tiny library, that enables
26
26
27
27
Functional builder for anything, enables you to modify object instances in a declarative way. Also contains `BuilderProvider` protocol with a computed `builder` property and implements that protocol on `NSObject` type.
Functional closures allow you to setup functional handlers & datasources, the API may seem a bit strange at the first look, so feel free to ask or discuss anything [here](https://github.com/MakeupStudio/swift-declarative-configuration/issues/1).
@@ -52,7 +56,7 @@ class ImageViewController: UIViewController {
52
56
}
53
57
```
54
58
55
-
### UIKit & FunctionalConfigurator
59
+
### FunctionalConfigurator
56
60
57
61
```swift
58
62
importFunctionalConfigurator
@@ -75,7 +79,7 @@ class ImageViewController: UIViewController {
75
79
76
80
**Note:** This way is **recommended**, but remember, that custom types **MUST** implement initializer with no parameters even if the superclass already has it or you will get a crash otherwise.
77
81
78
-
### UIKit & FunctionalBuilder
82
+
### FunctionalBuilder
79
83
80
84
```swift
81
85
importFunctionalBuilder
@@ -96,7 +100,97 @@ class ImageViewController: UIViewController {
96
100
97
101
Note: This way is recommended too, and it is more **safe**, because it modifies existing objects.
> **Note:** Your NSObject classes **must** implement `init()` to use Configurators. It's a little trade-off for the convenience it brings to your codebase, see [tests](./Tests/DeclarativeConfigurationTests/ConfiguratorTests.swift) for an example.
133
227
134
-
#### FunctionalHandler
228
+
#### FunctionalDataSource
135
229
136
-
> README PLACEHOLDER (Not yet written 😅)
230
+
`FunctionalDataSource` type is very similar to the `FunctionalHandler`, but if `FunctionalHandler<Input>` is kinda `FunctionalDataSource<Input, Void>`, the second one may have different types of an output. Usage is similar, different types are provided just for better semantics.
0 commit comments