Improve README Props intro, cleanup constraints

This commit is contained in:
Max Desiatov 2019-02-21 09:54:07 +00:00
parent 29e5a2b0a1
commit 832ad4ce17
No known key found for this signature in database
GPG Key ID: FE08EBF9CF58CBA2
2 changed files with 3 additions and 3 deletions

View File

@ -145,7 +145,8 @@ all built upon a few basic concepts:
### Props
`Props` describe a "configuration" of what you'd like to see on user's screen.
`Props` are immutable and
An example could be a `struct` describing background color, layout, initial
value etc. `Props` are immutable and
[`Equatable`](https://developer.apple.com/documentation/swift/equatable), which
allows us to observe when they change. You always use `struct` or `enum` and
never use `class` for props so that immutability is guaranteed. You wouldn't

View File

@ -11,8 +11,7 @@ public struct Trailing: Equatable {
public static func equal(
to target: Constraint.SafeAreaTarget,
constant: Double = 0,
multiplier: Double = 1
constant: Double = 0
) -> Constraint {
return .trailing(Trailing(
target: target, constant: constant