Improve README Props intro, cleanup constraints
This commit is contained in:
parent
29e5a2b0a1
commit
832ad4ce17
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue