Declarative UIKit for iOS apps
PROTOCOL
ObjectDHDeclarablepublic protocol ObjectDHDeclarable: AnyObject
The foundational object for all other objects in DHDeclarable
declaredWith(_:)@discardableResult func declaredWith(_ then: (_ instance: T) -> Void) -> T
Provides a then to configure instances inline.
self as the argument.then.| Name | Description |
|---|---|
| then | A then self as the argument. |
declaredIf(_:_:)@discardableResult func declaredIf(_ value: Bool, _ then: (_ instance: T) -> Void) -> T
Provides a then to configure instance inline based on a boolean test
self as the argument if the boolean test is truethen| Name | Description |
|---|---|
| then | A then self as the argument if the boolean test is true |
declaredIf(_:_:otherwise:)@discardableResult func declaredIf(_ value: Bool, _ then: (_ instance: T) -> Void, otherwise: ((_ instance: T) -> Void)?) -> T
Provides a then to configure instance inline based on a boolean test
self as the argument if the boolean test is trueself as the argument if the boolean test is falsethen or otherwise| Name | Description |
|---|---|
| then | A then self as the argument if the boolean test is true |
| otherwise | A then self as the argument if the boolean test is false |